In poring over the config files again, I see that both servers have identical httpd.conf
files, but they include different files from the "extra"
subdirectory to define the vhosts
. (I'm based on XAMPP for Linux 1.8.2-6
, which has httpd.conf
in /opt/lampp/etc/
and a directory /opt/lampp/etc/extra/
containing various other conf files, including vhosts.conf
).
The common httpd.conf
file has DocumentRoot "/opt/lampp/htdocs"
and it contains roughly this near the top:
<Directory />
AllowOverride none
Require all denied
</Directory>
<Directory "/opt/lampp/htdocs">
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Require all granted
</Directory>
On the server that gives a directory listing, the vhosts.conf
file contains no Options
directives at all. So it makes perfect sense that the Options
directive from httpd.conf
effectively enables Indexes.
On the server that gives the Access Denied
error, the vhosts.conf
file contains these directives:
<Directory /opt/lampp/htdocs>
AllowOverride None
Options FollowSymLinks
</Directory>
<Directory "/opt/lampp/htdocs/xampp">
AllowOverride All
Options FollowSymLinks Indexes
</Directory>
<Directory "/opt/lampp/htdocs/test">
AllowOverride All
Options FollowSymLinks Indexes
</Directory>
<Directory "/opt/lampp/phpmyadmin">
AllowOverride All
Options FollowSymLinks Indexes
</Directory>
I think what's happening is that because none of the Options
directives contain "+" or "-" prefixes on their attributes, the Options FollowSymLinks
directive in the first directory section of this file has the effect of cancelling all the other attributes (including Indexes
) from the first Options
directive in the httpd.conf
file!
And in fact I just "proved" it by editing the vhosts.conf
file on the server that gave the directory listing, to add:
<Directory /opt/lampp/htdocs>
Options FollowSymLinks
</Directory>
That one change (and running lampp reloadapache
) caused that server also to give the access denied error, just like the other server.
Although I could leave things this way, I think I'll change all three configuration files to start out with Options None
for "/" and Options +FollowSymLinks +Indexes +ExecCGI +Includes
for "/opt/lampp/htdocs" in the httpd.conf
file. And in the vhosts.conf
files I'll put:
<Directory /opt/lampp/htdocs>
Options +FollowSymLinks -Indexes -ExecCGI -Includes
</Directory>
root
access is often required even if Apache is sand-boxed. Also, check the conf files or .htaccess file to ensure thatoptions indexes
is enabled. It is also possible that the files are uploaded using another user name and permissions that Apache has no access to. Cheers!!/uploads/
(ie. with a trailing slash)? If you do (temporarily) put anindex.html
file in that directory (assuming that is a definedDirectoryIndex
), is it served? Have you tried it with another "test" directory?