Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Running apache on Fedora.

My virtual host config looks like :

NameVirtualHost 184.106.108.173:80

<VirtualHost 184.106.108.173:80>
  ServerName www.sandboxmadness.com
  DocumentRoot /var/www/admin/public
    <Directory "/var/www/admin/public">
      Options Indexes FollowSymLinks
      AllowOverride All   
      Order allow,deny
      Allow from all
  </Directory>
</VirtualHost>
<VirtualHost 184.106.108.173:80>
  ServerAlias www.meatball-parm.us
  DocumentRoot /var/www/meatball
  ServerName www.meatball-parm.us
  DirectoryIndex index.html
</VirtualHost>

The first vhost works like a champ. When I resolve the meatball address, the browser opens the right folder, but displays a directory listing, instead of opening the index file.

share|improve this question
    
Hate to ask the obvious question but. . . have you restarted Apache? –  Rilindo Oct 12 '11 at 15:47
    
yessir, definitely restarted apache. . . –  TuK Oct 12 '11 at 15:49
1  
You may want to try clearing yourbrowser cache. When I try www.meatball-parm.us I get connected and redirected to a worldpress install/blog. –  Iain Oct 12 '11 at 18:00
1  
Fixed it. . . it turned out to be a depreciated DirectoryIndex directive hidden away in the main conf file. Looks like a virtual host directive will not override a directive specified in the main conf. Stackexchange wont let me answer my question for another 4 hours. (Not enough rep) Thanks for all the help though ;) –  TuK Oct 12 '11 at 18:27

2 Answers 2

up vote 1 down vote accepted

Found it. . . there was another DirectoryIndex directive buried in the conf file, that was set to index.php. Apparently a directive specified in a virtual host does not overwrite directives specified in the 'main configuration'.

share|improve this answer

Could you check your logs ? You will maybe see an error (file not openable, directory not readable...). If you type the URL with the end with index.html, is it working ? Your index is not PHP or something else ?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.