Super User is a question and answer site for computer enthusiasts and power users. 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 have created a file called newsite in sites-available directory. It has the following contents:

<VirtualHost *:80>
    DocumentRoot /home/me/Development/www/newsite
    ServerAlias *

In the /etc/hosts file I have created an entry as follows:

I then enabled the site using a2ensite, and restarted apache, but when I browse to the site it wants to load from the public web.

Also, earlier today the problem was that it was showing Ubuntu's default index.html, but not the one from /var/www. (I modified this one just to check...)

What am I doing wrong?


share|improve this question

What happens if you replace:

with:    localhost.localdomain localhost

I'm just worried that the Apache process will try and resolve 'localhost' and won't be able too. Also, what happens when you try to 'host' from the local terminal? It might be worth checking '/etc/resolv.conf' to make sure the DNS lookup order is 'hosts,bind'. This will ensure it looks at the hosts file before querying the DNS server.

One last thing to check is the permissions on the DocumentRoot. Make sure Apache and read from there.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .