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

In the /etc/hosts file I have created an entry as follows:     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?



What happens if you replace:    newsite.biz

with:    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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.