Why is Apache not listing any files in an open directory?
March 25, 2008 9:46 PM   Subscribe

I've been helping my friend setup his personal website and we have been muddling through with plenty of help from google and a little bit of luck. But recently, I've been stumped by a persistent problem with a directory containing some files. Here's the scenario - my friend shares his RSS reading list as an OPML file. In addition, he wants to try and show how his reading list has evolved by archiving older versions of his reading list in a folder. He also wants to allow other people to browse this archive folder. It seemed like we should be able to achieve this using .htaccess files, but unfortunately it's not working like we expected.

The .htaccess file that we came up with is as follows:
Options +Indexes +MultiViews +FollowSymlinks

IndexOptions FancyIndexing


order allow,deny
allow from all
The directory can be viewed at this link. At first I thought it might be a problem with file permissions, so I tried CHMOD'ing all files to 777 but the folder remains empty. Next, I tried to see if any file was getting displayed and uploaded a text file and a jpeg to the directory and found that nothing changes. So it isn't a problem with unrecognized file types, nothing is getting picked up!

In the root folder of the linkblog, there is a htaccess file that has the following entry:
# BEGIN Prevent Directory Listing
IndexIgnore *
# END Prevent Directory Listing
I tried to force an override by including an Override Indexes command as follows:
< Directory "/home/content/linkblog/resources/opml_archive" >
AllowOverride Indexes
That only resulted in a "500 Internal Server Error".

Additional info: The server is hosted at GoDaddy.

If the question seems long and rambly, apologies - this is my first question to AskMeFi and I figured it's better to go overboard with the data points :)
posted by your mildly obsessive average geek to Computers & Internet (4 answers total)
 
Did you chmod the parent directory as well?
posted by null terminated at 10:11 PM on March 25, 2008


Actually, "IndexIgnore *" is almost definitely doing this. I would first comment this out to make sure this is causing the problem. If IndexIgnore is necessary, I would create an .htaccess file in opml_archive containing "Indexignore .htaccess". However, I don't know if this overrides previous settings or just adds ".htaccess" to the ignore list.
posted by null terminated at 10:16 PM on March 25, 2008


Best answer: To be clear, removing IndexIgnore should fix the problem. If you want to not list indexes in other directories, you should replace "IndexIgnore *" with "Options -Indexes". This should cause "Options +Indexes" to work on subdirectories (this should be put in an .htaccess file in opml_archive). I haven't tested any of this.
posted by null terminated at 10:21 PM on March 25, 2008 [1 favorite]


Response by poster: null terminated: " The "Options -Indexes" change fixed it!

I can now see files in the opml_archive directory while the parent directory still returns a 403 error (I had the IndexIgnore on because it was a "recommended" security practice for Wordpress blogs).

Thank you so much!
posted by your mildly obsessive average geek at 10:48 PM on March 25, 2008


« Older How can I get my cat to stop knocking stuff over?   |   He Can Pluck My Strings Any Time. Newer »
This thread is closed to new comments.