Apache Dir MOD+ ln

luminoso

To fold or to FOLD?
Viva.. estou a usar ubuntu 5.10 com o kernel 2.6.15.3 compilado por mim..

Neste momento estou a usar o apache para listar uma serie documentos em /home/luminoso/public_html para a minha turma de biologia. A cena está a ficar com um tamanho jeitoso, entao queria descentralizar a localizaçao dos ficheiros.

Ou seja:

putozao@khona4:~/public_html$ ln -s http://clientes.netvisao.pt/~lumos/desktoplumis.jpg teste.jpg
putozao@khona4:~/public_html$ ls -al
total 12
drwx---rwx 2 putozao putozao 4096 2006-02-09 20:06 .
drwxrwx--x 5 putozao putozao 4096 2006-02-09 14:19 ..
-rw----rwx 1 putozao putozao 45 2006-02-09 08:56 teste
lrwxrwxrwx 1 putozao putozao 51 2006-02-09 20:06 teste.jpg -> http://clientes.netvisao.pt/~lumos/desktoplumis.jpg
putozao@khona4:~/public_html$

em que ao cliclar em teste.jpg este se dirigisse para http://clientes.netvisao.pt/~lumos/desktoplumis.jpg . Parece, em teoria, fazer logica.. agora queria mm era que funcionasse...

luminoso@khona4:~$ apache -version
Server version: Apache/1.3.33 (Debian GNU/Linux)
Server built: Jan 6 2006 14:23:52
 
Tens uma opção de config do apache que é AllowSymLinks (acho que é este o nome) que permite fazer isso que queres e q vem desligada por defeito por uma questão de segurança. Mas vai aos docs presentes no site do apache que está lá tudo.
 
Hum.. apos alguma pesquisa no google e tal... nada.. entao em /etc/apache/httpd.conf

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Order deny,allow
Deny from all
</Limit>
</Directory>
</IfModule>

para

#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec FollowSymLinks
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
Order deny,allow
Deny from all
</Limit>
</Directory>
</IfModule>

root@khona4:/home/putozao/public_html# ln -fs http://clientes.netvisao.pt/~lumos/desktoplumis.jpg teste.jpg

como consequencia:

Not Found

The requested URL /~putozao/teste.jpg was not found on this server.
Apache/1.3.33 Server at localhost Port 80
 
Back
Topo