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:
c:\winnt\system32\drivers\etc
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.
328 WebSphere Commerce V5.4 Handbook, Architecture and Integration Guide
3. Open the httpd.conf file with a text editor.
4. Change the value of ServerName for the virtual host entries added for
WebSphere Commerce to the host name added in 10.12.1, Add a new host
name to the hosts file on page 327.
5. Start the IBM HTTP Server Windows service.
10.12.3 Add host aliases to virtual hosts in the application server
To add host aliases to the virtual hosts on the WebSphere Application Server, do
the following:
1. Start the WebSphere Application Server Administrative Console.
2. Add the following to the list of host aliases for the default_host virtual host:
<new_webserver_hostname>:80
<new_webserver_hostname>:443
3. Stop and start the WebSphere Commerce Server - <instance> application
server.
4. Regenerate the Web server plug-ins.
Refer to Regenerate Web server plug-in on page 302 for details.
5. Restart the IBM HTTP Server Windows service.
10.12.4 Create an index file to refer to the store
When using an index file to refer to the store URL, there are two methods that
can be used:
Index file in document root - accessed by host name
Index file accessed by alias
First, you can create the index file in the document root directly so you can
access the store by just typing the host name. Second, you can add an alias to
the httpd.conf file to refer to the directory in which you placed the index file.
In the second case, you will have to type the host name followed by the alias to
go to the store. The first case means that you have to rename the already
existing index file that refers to the IBM HTTP Server administration server and
then whenever you want to access the server, you will have to type in the name
of the file that refers to it.

Get WebSphere Commerce V5.4 Handbook: Architecture and Integration Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.