Chapter 10. Windows two-tier remote DB2 database server runtime 327
10.12 Create a common host name or alias for the store
Normally, Web sites have a host name representative of the company to make it
easier for customers to remember and access the site. It is also much easier for
development/test purposes to be able to enter a common host name or a host
name and alias to access the store.
To make accessing the store easier, complete the following high-level steps:
1. Add a new host name to the hosts file.
2. Add virtual hosts for the IBM HTTP Server (httpd.conf).
3. Add host aliases to virtual hosts in the application server.
4. Create an index file to refer to the store.
10.12.1 Add a new host name to the hosts file
To add a new host name to the hosts file, do the following:
1. On the Web server, change to the following directory:
2. Open the hosts file with a text editor.
3. Add a new entry to the hosts file that corresponds to the same IP of the
machine and a new host name for it (for example, www.myteststore.com).
10.12.2 Add virtual hosts for the IBM HTTP Server (httpd.conf)
To add virtual hosts for the new host name, modify the IBM HTTP Server
httpd.conf as follows:
1. Stop the IBM HTTP Server Windows service.
2. Change to the <http_home>\conf directory.
Note: If you are OK with the current host name of your Web server, then step
1 and 2 are not required.
Note: The new host name has to refer to the IP at the DNS level, so that
the machines will be able to ping the Web server by using the host name.
In our case, we did not do this, because it is not a real environment.
Instead, we added an entry in the hosts file of each machine, the same
entry we added in step 2 above so that we were able to ping the server
using the new host name.