AutoIndex Permission

I was experimenting with PHP and MySQL, and wanted my localhost server to automatically list the contents of my home directory as I added new subdirectories.

When I removed the index.html and index.php files and opened the browser to that directory, it didn’t work! It gave “Permission denied: Can’t open directory”.

I looked into httpd.conf, and added Option Indexes right at the top, restarted Apache, but that made no difference.

I changed AllowOveride None to AllowOveride All, and put the commands into a .httpaccess file into the home directory, and still no change (entering garbage into .httpaccess did give an Invalid Command error, so I knew .httpaccess was being read).

In Terminal, I saw that all the permissions for my home directory were set except “read for other”:

drwxrwx-wx 32 GG GG 1088 Jan 9 22:52 Sites/

To solve the problem:

chmod +r Sites

That did it! Now I have server-generated directory listings.

Advertisements

Published by

macenable

computer programmer, group organizer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s