1

On a newly installed Centos 6.3

I imported the config from Ubuntu for a virtualhost. Here is the piece of config

DocumentRoot /otherhome/test.cofares.net ServerName test.cofares.net <Directory "/otherhome/test.cofares.net"> allow from all Options +Indexes </Directory> 

A request to the http://test.cofares.net I get the folowwing error in the error log

Directory index forbidden by Options directive: /otherhome/test.cofares.net/ 

The directory index worked for a sub directory http://test.cofares.net/test is OK

Any suggestions what is missing?

The same config work well with Ubuntu Server 12.04.

2 Answers 2

0

Try this. And make sure to restart apache after applying:

<Directory "/otherhome/test.cofares.net"> Options +Indexes FollowSymLinks AllowOverride all Order Allow, Deny Allow from All Satisfy All </Directory> 

And perhaps try this with Satisfy Any instead:

<Directory "/otherhome/test.cofares.net"> Options +Indexes FollowSymLinks AllowOverride all Order Allow, Deny Allow from All Satisfy Any </Directory> 

EDIT: Those didn’t seem to work? Then try this. Note I am setting up the whole <VirtualHost> directive & removed quotes from the <Directory> directive:

<VirtualHost *:80> DocumentRoot /otherhome/test.cofares.net ServerName test.cofares.net <Directory /otherhome/test.cofares.net> Options Indexes FollowSymLinks Allow from All </Directory> </VirtualHost> 
Sign up to request clarification or add additional context in comments.

1 Comment

after digging i found the offending conf in welcome.conf I removed it it is now OK thanks for your helps <LocationMatch "^/+$"> Options -Indexes ErrorDocument 403 /error/noindex.html </LocationMatch>
0

After digging a little I noticed that thire is a global rule (in conf.d/welcome.conf) that prevent indexing the / directory of any virtual server

By removing it it is now ok

Here is the rule that must be change

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.