Creating name based Virtual Hosts with Apache in Ubuntu 10.04 is easy, and there’s lots of documentation available to help you out. But I didn’t want to run a public webserver and the instructions I found were not making my defined ServerNames available locally.
After going around in circles for a while I found the simple piece of the puzzle I’d been overlooking.
To create name based virtualhosts available locally with Apache2, create and enable your site as usual (using a2ensite) and then, edit the file at /etc/hosts to include your new ‘ServerName’ at 127.0.0.1.
e.g.
127.0.0.1 mynewsite.local
127.0.0.1 localhost
Simples.



