Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Ubuntu 10.04 and Apache2.2 on a Linode VPS - I'm trying to create a subdomain of I've added this entry to /etc/apache2/sites-enabled:

<VirtualHost *:80>
     DocumentRoot /srv/www/
     ErrorLog /srv/www/
     CustomLog /srv/www/ combined

and this line to /etc/hosts:

and created a DNS zone file pointing to

I can successfully ping but can't get index.html to load in my browser...

Any ideas?

share|improve this question
What does the error.log and access.log tells you? – Rilindo Jul 4 '11 at 16:06
up vote 2 down vote accepted

Since you're using virtual hosts, make sure to put this subdomain container BEFORE your main virtual host container. What ever comes first trumps whatever comes after, so if your file looks like this, it won't work:

<virtualHost *:80>
 ServerAlias *
 DocumentRoot /srv/www/

<VirtualHost *:80>
 DocumentRoot /srv/www/

Make sense? You have to flip them, so that the 2nd VirtualHost container in my example is first. If that's not the problem, and you've already done this, then check the Apache error log (actually, that should be your first step, regardless).

Also, make sure file permissions are correct.

share|improve this answer

Be sure that you have NameVirtualHost *:80 somewhere in your configuration files. Debian adds it in default configuration in the file /etc/apache2/ports.conf (I guess that Ubuntu do the same). Then debug your vhost configuration with apache2ctl -S as root, it will give you a list of correctly configured virtual hosts. The output should be similar to this

VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server usually-default-hostname (/etc/apache2/sites-enabled/000-default:1)
         port 80 namevhost (/etc/apache2/sites-enabled/your-config:1)

If your vhost is not listed here that's why you can't browse it (ensure you've reloaded the apache configuration with /etc/init.d/apache2 reload before browsing).

See here for full instructions to setup vhosts in apache under Debian/Ubuntu

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.