Forum Moderators: phranque
Alias /otro "/var"
I can Acces localhost/var normally by if I try to access via localhost/otro I get the following error:
Forbidden
You don't have permission to access /otro/ on this server.
I've given all permissions to var folder but the problem doesn't disappear. (Anyway, it doesn't make much sense).
Any idea on how to solve this problem? I've read that it can be solved by disabling selinux. I think I have done so: In the file /etc/selinux/config I have set it as disabled, but the problem doesn't disapperar.
Alias /otro "/var"
Welcome to WebmasterWorld kaidok. The documentation for alias [httpd.apache.org] shows the following syntax with no quote marks:
Alias /otro /var If that doesn't change anything, do your logs show anything? Is the var directory really executable for the user under which Apache is running?
Anyway, onto my question, the quote maks doesn't make any difference, the var directory has the following pemisses:
drwxrwxrwx 2 nobody nobody 4096 may 12 23:01 var
So I guess it should be executable, in fact if I enter localhost/var it goes smoothly.
My log shows the following error when I enter localhost/otro, but it doesn't make any sense to me:
[Thu May 14 02:51:40 2009] [error] [client 127.0.0.1] Directory index forbidden by rule: /var/
<Directory> section - for example, if your httpd.conf by default only allows access for files held withihn your existing document root, you will need to add similar rules for /var also. [httpd.apache.org...]
Note that you may need to specify additional <Directory> sections which cover the destination of aliases. Aliasing occurs before <Directory> sections are checked, so only the destination of aliases are affected.
I'm intrigued by your need to allowpublic access to /var - isn't there a risk because the end user will be able to access places like /var/lib?
In response to your question this was just a test to check how alias worked, I'm not going to allow access to this folder in the real application.
Thanks a lot for your help.