Click to See Complete Forum and Search --> : apache file listing
hi,
suppose I have a symbolic link to a directory in my /var/www and I've
chown -r www-data:www-data <directory_symbolic_link_points_to>
shouldn't I be able to see the directory listing by just going to
127.0.01/symbolic_link_name ?
well,I can't , I get access forbidden.
how can I fix this ?
gamblor01
12-24-2007, 09:41 AM
Is "www-data" the correct user? Typically the user is just "apache". You can do the command "ps -ef | grep httpd" to see which user is running that process. That's the user that needs to have read permissions on the files.
Even if that is the correct user, perhaps they're not in the right group (maybe they need to be in the apache group? It's just a guess). You might try checking /etc/group to see if there's an apache group in there. If so, try doing "usermod -G apache www-data". That will add the www-data user as another user in the apache group.
bwkaz
12-26-2007, 12:07 AM
By default Apache doesn't allow symlinks outside the DocumentRoot. It's a security thing -- if you give users the ability to publish web content from a given subdirectory of their home directory (e.g. /home/you/www, for instance, gets published as "http://blah/~you"), then the user can create a symlink to (e.g.) /bin or /lib or /etc, and if Apache followed the symlink, it would be letting remote machines read files that were never meant to be read from remote machines.
I think you can turn this off, but you can also set a FollowSymlinksIfOwnerMatch option, which is better for security (since the user that creates the symlink and the user that creates the target directory must be the same). I'd recommend looking that up in the Apache manual and adding it to the configuration. :)