Running Ubuntu 10.04
My server serves 3 different domains using named virtual hosts in Apache2. I'm current using different Named Virtual Servers to 301 redirect www to the non-www equivalent. It's working, but I don't understand the correct entries for my /etc/hosts file and I think that is causing problems for me trying to setup Varnish.
I understand I need the localhost line
127.0.0.1 localhost localhost.localdomain
Should I also list each domain here? as in
127.0.0.1 localhost localhost.localdomain example1.com example2.com example3.com
What about the entry for the IP of the server? Do I need the following line?
< IP.Of.Server > example1.com example2.com example3.com
Also, should I be listing www.example.com AND example.com on each line, so they go into Apache and it can deal with the 301 redir?