How do I setup a testing environment for virtual hosting?
This is not recommended for a production environment because it involves changing the way machines are found on your network. Consult the system administrator or site operator before making these kinds of changes. httpd.apache.org/docs-2.0/vhosts/index.html In order to test “Virtual Hosts, we need to set-up a system so it can be accessed by multiple host/domain names. This can be done in two ways. One is to have site-IT make the necessary DNS changes. This means the whole site gets affected. Another is to isolate a test system, and make some configuration changes, such that our tests are isolated. A. Setting up the system hosting Apache webserver. There are two ways. (i) Without changing DNS entries: Edit the file /etc/hosts Change: 192.168.1.1 yourserver yourserver.com 127.0.0.1 localhost loopback To: 192.168.1.1 yourserver yourserver.com 192.168.1.1 foo www.foo.com 192.168.1.1 bar www.bar.com 127.0.0.1 localhost loopback Edit the file /etc/nsswitch.conf Change: hosts: dns files To: h