Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have created a file called newsite in sites-available directory. It has the following contents:

<VirtualHost *:80>
    ServerAdmin admin@newsite.biz
    DocumentRoot /home/me/Development/www/newsite
    ServerName newsite.biz
    ServerAlias *.newsite.biz
</VirtualHost>

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

127.0.0.1     newsite.biz

I then enabled the site using a2ensite, and restarted apache, but when I browse to the site it wants to load newsite.biz 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?

Thanks!

share|improve this question
add comment

1 Answer

What happens if you replace:

127.0.0.1    newsite.biz

with:

127.0.0.1    localhost.localdomain localhost newsite.biz

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 newsite.biz' 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
add comment

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.