403 Forbidden / show directories

I have a directory that I want to just list the items when going to the URL instead of having an index.html page in the folder. I keep getting a 403 forbidden even though it is in my document root.

I tried to add:

Alias /keys/ "/var/www/html/keys/"

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

but its still not working

what am i missing?

The 2 obvious questions first:

  1. Did you reload the apache configuration after you changed it?
  2. Does the user apache is running as have access to the directory you specified?

yes and yes

I can get to all other directories and files on my server, just not this one, and the permissions are the same

/var/www/html> ls -lA
drwxr-xr-x   9 root  root   4096 2010-01-23 12:03 keys
drwxr-xr-x   2 root  root   4096 2009-11-10 19:47 resume

document root above.
resume folder works
keys gets 403

Hi.

I can't recreate your issue.

Is there perhaps a .htaccess file in the keys directory, which is not readable?

no just the directories of what i want displayed

That's odd.

I created a .htaccess file with rubbish, and got an internal server error.

Then I chmod'd the file to 400 and got forbidden, then deleted it and still got forbidden.

After restarting the webserver, it works OK again.

What does the error_log say?

fixed

I had to comment out a line in:

modsecurity.d/modsecurity_crs_50_outbound.conf
     52 # Directory Listing
     53 #SecRule RESPONSE_BODY "(?:<(?:TITLE>Index of.*?<H|title>Index of.*?<h)1>Index of|>\[To Parent Directory\]<\/[Aa]><br>)" \
     54 #        "phase:4,t:none,ctl:auditLogParts=+E,deny,log,auditlog,status:403,msg:'Directory Listing',id:'970013',tag:'LEAKAGE/INFO',severity:'4'"
     55