PDA

View Full Version : Directory index forbidden by Options directive:



listboxster
29th May 2006, 05:44 AM
Hi everyone.

I've setup this directive:

<Directory "/space/vhosts">
Options Indexes ExecCGI FollowSymLinks
AllowOverride Authconfig
Order allow,deny
Allow from all
deny from none
</Directory>

and when I go to: http://myhost.com/ I error out (which sends me to the Fedora welcome page) get:

/Directory index forbidden by Options directive: /space/vhosts/myhost.com/docs/, referer: http://myhost.com/

However, the bizarre part is that when I go to a subdirectory like http://myhost.com/subdirectory it does a directory listing just as you'd normally expect! But not in the root directory. :(

I am using "Dynamically Configured Mass Virtual Hosting (http://httpd.apache.org/docs/2.0/vhosts/mass.html) " if that matters.

It gets me because when I used FreeBSD back in the day I had no problems with this. When I switched over to Core3 this weird behavior started - same in Core 4, and now 5.

Please help!

Karen

Jman
30th May 2006, 02:55 AM
Search all of the Options directives, both in /etc/httpd/conf/httpd.conf and /etc/httpd/conf.d/*.conf

listboxster
30th May 2006, 04:20 AM
This is what I yeild:

[karen@utopia conf]$ cat httpd.conf | grep Options
Options FollowSymLinks
# Possible values for the Options directive are "None", "All",
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# The Options directive is both complicated and important. Please see
Options Indexes FollowSymLinks
# Options FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Options Indexes MultiViews
Options None
# IndexOptions: Controls the appearance of server-generated directory
#IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
IndexOptions FancyIndexing FoldersFirst VersionSort NameWidth=* SuppressIcon
# (You will also need to add "ExecCGI" to the "Options" directive.)
# (You will also need to add "Includes" to the "Options" directive.)
Options IncludesNoExec
Options Indexes ExecCGI FollowSymLinks


Do you think some of these directives are conflicting with others? But why would the root directory error out when the subdirectories produce a listing?

Anyway, how do you propose I proceed?

Thanks for your attention.

Karen
http://bluehairedgirl.com/

Jman
31st May 2006, 02:54 AM
Possibly those conflict. You probably have Indexes set on the location with your dynamic virtual hosts but not the main document root or something.

Though the Options lines look similar to the default config, just an extra one at the end.

You can turn LogLevel way up to see if it logs anything. Or adding it to a .htaccess file.

Also, simplifying the configuration helps. If you're not going to use the default /var/www/html setup comment that out and copy any relevant configuration to your mass virtual directive.

listboxster
31st May 2006, 03:19 AM
OK I did those things and set the error level to debug: no joy.

[Tue May 30 19:07:26 2006] [error] [client 192.168.1.2] Directory index forbidden by Options directive: /space/vhosts/myhost.com/docs/, referer: http://myhost.com/

[root@utopia conf]# cat httpd.conf | grep Options
# Options FollowSymLinks
# Possible values for the Options directive are "None", "All",
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# The Options directive is both complicated and important. Please see
# Options Indexes FollowSymLinks
# Options FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Options Indexes MultiViews
# Options None
# IndexOptions: Controls the appearance of server-generated directory
#IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
IndexOptions FancyIndexing FoldersFirst VersionSort NameWidth=* SuppressIcon
# (You will also need to add "ExecCGI" to the "Options" directive.)
# (You will also need to add "Includes" to the "Options" directive.)
# Options Indexes IncludesNoExec
Options Indexes ExecCGI FollowSymLinks

I guess it maybe a bug. What do you think?

Karen

listboxster
31st May 2006, 03:22 AM
Oh, and I commented out that "Options Indexes MultiViews" above as well - same same.

casey
28th August 2006, 01:21 AM
I was having the same exact problem as you, this is what fixed "/" directory listings for me

In /etc/httpd/conf.d you will see a file entitled welcome.conf

It looks like this:

<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>

Change it to this:

<LocationMatch "^/+$">
Options Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>

All we actually changed was the hyphen in front of Indexes. This worked for me, hopefully it works for you.