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.

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 www.accontax.be -> ../sites-available/www.accontax.be

Contents of the relevant virtual host:

cat /etc/apache2/sites-enabled/www.accontax.be

<VirtualHost *>
    ServerName  www.accontax.be
    ServerAlias accontax.be

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

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

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 http://www.accontax.be 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: 109.74.194.187:* li141-187.members.linode.com (/etc/apache2/sites-enabled/webmin.1273066327.conf:1) wildcard NameVirtualHosts and default servers: *:80 is a NameVirtualHost default server li141-187.members.linode.com (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost li141-187.members.linode.com (/etc/apache2/sites-enabled/000-default:1) port 80 namevhost www.accontax.be (/etc/apache2/sites-enabled/www.accontax.be:1) 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 (li141-187.members.linode.com)

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

NameVirtualHost * to NameVirtualHost 109.74.194.187:80

& 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.

<VirtualHost 109.74.194.187:80>
   ServerName 109.74.194.187
   .......

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

<VirtualHost 109.74.194.187:80>
   ServerName accontax.be
   ServerAlias www.accontax.be
   .......

then apache2ctl restart.

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

$ttl 38400
@   IN  SOA accontax.be li141-187.members.linode.com. (
            SOA_SERIAL_NUMBER
            10800
            3600
            604800
            38400 )
accontax.be.    IN  NS  ns1.linode.com.
accontax.be.    IN  NS  ns2.linode.com.
accontax.be.    IN  A   109.74.194.187
www.accontax.be.    IN  A   109.74.194.187
ftp.accontax.be.    IN  A   109.74.194.187
webmail.accontax.be.    IN  A   109.74.194.187
mail.accontax.be.   IN  A   109.74.194.187
accontax.be.    IN  MX  5 mail.accontax.be.
accontax.be.    IN  TXT "v=spf1 a mx a:accontax.be ip4:109.74.194.187 ?all"

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

& this link will give you more information about DNS configuration. http://www.intodns.com/accontax.be

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

 
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.