Forum Moderators: phranque

Message Too Old, No Replies

Alias permissions issue

Forbidden access using an alias

         

kaidok

9:27 pm on May 13, 2009 (gmt 0)

10+ Year Member



I have the following alias on my httpd.conf file:

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.

encyclo

10:34 pm on May 13, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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?

kaidok

11:00 pm on May 13, 2009 (gmt 0)

10+ Year Member



Hi. Thanks for answering and welcoming me. I should have introduced myself on my previous message... Well, I just hope that this site serves me right and also that I'm able to help.

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/

encyclo

12:17 am on May 14, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suspect that the server configuration elsewhere may be entering into play here - as the documentation warns, you should check whether /var is referenced in a
<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.

[httpd.apache.org...]

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?

kaidok

9:26 am on May 14, 2009 (gmt 0)

10+ Year Member



Sigh, I have tried all you are indicating to me and it doesn't work, I suppose I can make my application without using alias.

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.