Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have created a virtual host settings file and I disabled the default settings by using a2dissite default (this is a pretty standard Ubuntu 10.04 installation). But no matter what I try my Apache2 server simply keeps on displaying the default index.html page instead of the index.php page that I set up in the virtual host file. Can someone help me what I'm missing. Details follow:

No default settings:

ls -l /etc/apache2/sites-enabled/
total 0
lrwxrwxrwx 1 root root 51 May  5 13:32 webmin.1273066327.conf -> /etc/apache2/sites-available/webmin.1273066327.conf
lrwxrwxrwx 1 root root 34 May 30 11:03 -> ../sites-available/

Contents of the relevant virtual host:

cat /etc/apache2/sites-enabled/

<VirtualHost *>

    DirectoryIndex index.php
    DocumentRoot /var/www/drupal/

    <Directory /var/www/drupal/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all

Contents of httpd.conf:

cat /etc/apache2/httpd.conf

Listen 80
NameVirtualHost *

I also have those relevant lines in my apache2.conf:

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

When I visit I expect apache2 server go to the /var/www/drupal subdirectory and start serving index.php but it simply keeps on serving index.html from /var/www directory. I have reloaded the configuration, restarted the server, deleted my browser cache. Nothing changed.

Probably I'm missing a simple yet crucial step but I just could not find it.

PS: When I ssh to the server and try to browse the localhost it works as I expect!

share|improve this question
Are you still seeing this issue? The config looks fine, and the address you gave seems OK too when browsed from my place. –  Karol Piczak May 30 '10 at 14:10
In order to fix it temporarily I have added Redirect directive to my httpd.conf, so the current situation is not a real solution in context defined above. –  Emre Sevinç May 30 '10 at 14:20
can u send dump of "apache2ctl -t -D DUMP_VHOSTS" & domain's dns records in bind here ? –  risyasin May 30 '10 at 22:11
$ apache2ctl -t -D DUMP_VHOSTS VirtualHost configuration:* (/etc/apache2/sites-enabled/webmin.1273066327.conf:1) wildcard NameVirtualHosts and default servers: *:80 is a NameVirtualHost default server (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost (/etc/apache2/sites-enabled/ Syntax OK –  Emre Sevinç May 31 '10 at 9:36

1 Answer 1

up vote 1 down vote accepted

i assume that your hostname is proper (

in /etc/apache2/httpd.conf change the line below,

NameVirtualHost * to NameVirtualHost

& there can be a duplicate NameVirtualHost in your /etc/apache2/sites-enabled/webmin.1273066327.conf file in line 1. check if exists. if yes delete that line.

& edit the VirtualHost definition in /etc/apache2/sites-enabled/000-default file as follows.


& edit the lines in /etc/apache2/sites-enabled/ as follows.


then apache2ctl restart.

& and also check you bind's zone file for, it should be like configuration below.

$ttl 38400
@   IN  SOA (
            38400 )    IN  NS    IN  NS    IN  A    IN  A    IN  A    IN  A   IN  A    IN  MX  5    IN  TXT "v=spf1 a mx ip4: ?all"

there should be your own serial number for domain, says so. change SOA_SERIAL_NUMBER with your own above.

& this link will give you more information about DNS configuration.

it seems your are using webmin. it's much better to do all these changes in webmin for you. Check everything under "Servers" menu, in apache menu, check your module config is ok before changing anything. & also change startup command for apache in webmin to apache2ctl. do not allow webmin to use /etc/init.d/apache2 script.

share|improve this answer

Your Answer


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.