Allow subdirectory with Apache

You should not need to specifically allow access to a directory below one which is already configured within httpd.conf

Since /var/www/html is configured with "AllowOverride None" then the problem is not due a .htaccess file changing the access rights.

The only remaining reason is that the permissions on the files and directories do not permit the webserver uid to read from this directory. What they are, and what they should be depends on your security model. But as a quick fix you could try:

# chmod a+rx /var/www/html/test
# chmod a+r /var/www/html/*

If this solves the problem then please take time to fix the ownership and permissions of the files to something more appropriate.


Usually I recommend to take a look first to http error_log to see the exact problem.

With default configuration you should be able to access workshop-5.4 directory:

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

If you still cannot access the directory everything points to directory permissions, in that case I suggest to try:

chown -R apache.apache /var/www/html  # Assuming apache as default User
chmod -R 755 /var/www/html            # Making sure all users can read and execute

On a separate terminal run following commands:

apachectl configtest && apachectl restart
tail -f /etc/httpd/logs/error_log     # Assuming default error_log location

Try to add a simple html file like (example.html):

<html>
<head><body>It works!</body></head>
</html>

Finally, reload the page, try to load example.html and take a look to the output of the tail command.