Before you start
This tutorial describes how to configure the IBM HTTP Server with the WebSphere Commerce Development environment. Sample configuration files and step-by-step instructions are provided.
The final objective is to have the IBM HTTP Server listen to and respond on the specified ports, communicating with the WebSphere Commerce Test Server. The Apache Web server will listen on ports 80 and 443, while all other ports continue to be monitored by the WebSphere Commerce Test Server. We provide you with a sample Web server configuration file that you can begin making changes to immediately. This file will also demonstrate some special Web server configurations. Figure 1 shows how your Web server will be configured after you complete this tutorial.
Figure 1. Configured Web server
This tutorial is written for Java™ programmers with skills and experience at a beginner level. You need general familiarity with the WebSphere Commerce development environment. Additionally, you also need to be familiar with configuring the IBM HTTP Server.
To create the examples in this tutorial, you need WebSphere Commerce Developer V6 installed and configured.
This tutorial takes about one hour to complete.
The WebSphere Commerce development environment is packaged with a WebSphere Commerce Test Server that acts as both a Web server and an application server. However, the Web server functionality has some limitations. Configuring an Apache Web server to interoperate between the client and the WebSphere Commerce Test Server is useful in some situations. Using an Apache Web server in your development environment is useful if you:
- Have a search engine optimization strategy where you use mod_rewrites.
- Want to enable file compression, file caching, configure expiration dates for static content to increase performance, or tune your application.
- Are doing mash-up development.
- Want to configure a reverse proxy to route your requests elsewhere.
This tutorial will walk you through the steps to install the IBM HTTP Server and configure it to work with the WebSphere Commerce development environment. If your intent is to configure the Web server for search engine optimization, we recommend that you read Search engine optimization: Improving findability with a configurable URL tag library.
Several steps are needed to configure both the IBM HTTP Server and the WebSphere Commerce Development environment. At a high-level, the steps are:
- Download the IBM HTTP Server.
- Install the IBM HTTP Server.
- Download the WebSphere Application Server plugin.
- Install the WebSphere Application Server plugin.
- Configure the IBM HTTP Server.
- Copy the plugin-config.xml file.
- Configure the WebSphere Commerce Test Server.
Step 1. Download the IBM HTTP Server
If you have already purchased WebSphere software, you may already have an installable version of the IBM HTTP Server. If not, you can download the IBM HTTP Server 6.1. You need about 1.5GB of storage to save and extract the archive. Download this archive and place it on your WebSphere Commerce Developer system. You are now ready to install the IBM HTTP Server.
Step 2. Install the IBM HTTP Server
- Unzip the package you downloaded to a temporary directory called
c:\WebSphere_download. Double-click the file
to begin the install process. Follow the installation wizard through
the first few screens. On the install directory screen, select
C:\WebSphere\IHS as shown in Figure 2.
Figure 2. IBM HTTP Server install directory
- Leave the port values for the HTTP and HTTP Administration servers as 80 and 8008. Click Next.
- On the "Windows Service Definition" screen, make sure both the HTTP and HTTP Administration servers are set to run as a Windows® service.
- Select Log on as a specified user account and use a
user that has Windows administrative authority (Figure 3). Click
Figure 3. Windows Service Definition
- On the "HTTP Administration Server Authentication" screen make sure Create a user ID for IBM HTTP Server administration server authentication is unchecked. Click Next.
- You are presented with a summary screen as shown in Figure 4. Review
your choices and click Next to install the IBM HTTP
Figure 4. IHS Summary
- The wizard will install the IBM HTTP Server. When complete, click Finish to exit the installation wizard.
This completes the IBM HTTP Server installation and leads you to the next section on Web server plugin installation.
Step 3. Download the WebSphere Application Server V6.1 plugin
The WebSphere plugin is a piece of code that bridges the IBM HTTP Server with the WebSphere Commerce server. It defines how the two servers communicate. You can download the WebSphere Application Server V6.1 plugin. You are now ready to install the WebServer plugin for WebSphere Application Server for Windows.
Step 4. Install the WebSphere Application Server plugin
- Unzip the package you downloaded to a temporary directory called
c:\WebSphere_download\Plugin. Double-click the
to begin the install process. On the welcome screen, ensure all the
checkboxs are not selected as shown in Figure 5. Click
Figure 5. WebSphere Application Server Plugin Welcome screen
- Select IBM HTTP Server V6 or V6.1 and click Next.
- Select Web server machine (remote) and click Next.
- Choose C:\WebSphere\Plugins as the installation
directory and click Next as shown in Figure 6.
Figure 6. Plugin installation directory
- Specify the HTTP Server httpd.conf file location that was installed
in the previous wizard. The path in our example is
C:\WebSphere\IHS\conf\httpd.conf. Ensure port 80 is the selected port as shown in Figure 7. Click Next.
Figure 7. httpd.conf file location
- Make sure the Web server definition name is webserver1. Click Next.
- Leave the default plugin configuration file location as it is and click Next.
- Specify the application server name. For example, "localhost" is a local computer's name. Click Next.
- Continue clicking Next until you get to the
installation summary screen. Ensure all the settings are correct and
click Next to install the WebSphere Application
Server plugin as shown in Figure 8.
Figure 8. Installation Summary
- Click Finish to complete the wizard.
You have now installed the WebSphere Application Server plugin. Next, you will configure the IBM HTTP Server.
Step 5. Configure the IBM HTTP Server
By default, the IBM HTTP Server configuration file is not configured to
support SSL. You will need to configure the server to support SSL. You can
use a SSL self-signed certificate or an externally signed certificate from
a third party. A self-signed certificate is included in the download file for this tutorial in the
IHS\SSLKeys directory. The password for this key is
"is8enuff". A sample httpd.conf file is located in
- Copy the IHS\SSLKeys directory to C:\WebSphere\IHS.
- Backup the C:\WebSphere\IHS\conf\httpd.conf file.
- Open the C:\WebSphere\IHS\conf\httpd.conf file.
- Copy the following lines into the bottom of the file:
Listing 1. httpd.conf configuration
You will need to alter the Alias lines to match your environment. To learn how you can apply mod_rewrite rules to work in conjunction with WebSphere Commerce, see Improving findability with a configurable URL tag library.
- Disable AFPA by commenting out the following lines:
Listing 2. Disabling AFPA
## ## To enable AFPA on supported Windows Operating Systems delete the "#" symbol in ## front of the "LoadModule ibm_afpa_module modules/mod_afpa_cache.so" directive ## #LoadModule ibm_afpa_module modules/mod_afpa_cache.so #<IfModule mod_afpa_cache.c> # AfpaEnable # AfpaCache on # AfpaPort 80 # AfpaLogFile "C:/IHS/logs/afpalog" V-ECLF #</IfModule> ## ## Configuration with AFPA disabled ## #<IfModule !mod_afpa_cache.c> # Listen 80 # Use Win32DisableAcceptEx to downgrade to use winsock 1.1 network APIs. # Note: You can use Win32DisableAcceptEx only if mod_afpa_cache.so is disabled. # Win32DisableAcceptEx #</IfModule>
- Modify the DocumentRoot entry to match the location that you used for
the /wcsstore aliases above. For example:
- Find <Directory "C:/IHS/htdocs/en_US"> and
change the directory path to the location you used for the /wcsstore
aliases above. For example:
- Save the httpd.conf file.
You are now finished configuring the IBM HTTP Server. Next, you will need to copy the plugin-config.xml file so that the WebSphere plugin knows which requests to send to the WebSphere Commerce Test Server.
Step 6. Copy plugin-cfg.xml file to the WebSphere plugin directory
The WebSphere Application Server plugin uses a configuration file,
plugin-config.xml, that defines which requests need to be
forwarded from the IBM HTTP Server to the WebSphere Commerce Test Server.
A configuration file has been provided for you to use in the download file for this tutorial in the Plugins
directory. Copy the Plugins\config directory to
You may need to make changes to the plugin-cfg.xml file to match your
environment, especially if you've changed the WebSphere Commerce context
/webapp/wcs to another value.
Next, you will need to configure the WebSphere Commerce Test Server to support communication with the IBM HTTP Server.
Step 7. Configure the WebSphere Commerce Test Server
By default, the WebSphere Commerce Test Server listens for requests on ports 80 and 443. Since you have just configured the IBM HTTP Server to listen on these ports, you must change the WebSphere Commerce Test Server to listen on different ports to remove the conflict. This tutorial uses ports 10080 and 10443 for ports 80 and 443, respectively.
A WebSphere Application Server wsadmin jython script is provided in the download file for this tutorial as
WAS\configureWCPorts.py. Depending on your configuration, you
may need to change the nodename and hostname parts of this file before
running it. We are assuming the default configuration in this script.
Listing 3. wsadmin script to change the Test Server ports
AdminTask.modifyServerPort ('server1', '[-nodeName localhost -endPointName WC_defaulthost -host localhost -port 10080]') AdminTask.modifyServerPort ('server1', '[-nodeName localhost -endPointName WC_defaulthost_secure -host localhost -port 10443]') AdminConfig.save()
- Ensure WebSphere Commerce Test Server is stopped.
- Copy the WAS\configureWCPorts.py script to the <WCTOOLKIT>\wasprofile\bin directory.
- Open a Windows command prompt and change the directory to <WCTOOLKIT>\wasprofile\bin.
wsadmin -lang jython -f configureWCPorts.py -conntype NONE.
- Start the WebSphere Commerce Test Server.
- Start or restart the IBM HTTP Server.
You can test your configuration by accessing your WebSphere Commerce stores using a Web browser. Notice in the IBM HTTP Server access.log that requests are now being logged. This indicates that the IBM HTTP Server is handling requests for ports 80 and 443. You are now finished configuring the WebSphere Commerce Test Server to help communicate with the IBM HTTP Server.
In this tutorial, you have configured and installed the IBM HTTP Web server on your WebSphere Commerce development machine to handle Web based requests for ports 80 and 8000. You can start and stop the Web server from your Windows Services control panel. The service is called "IBM HTTP Server 6.1" and, by default, is started automatically when your machine reboots. When you have successfully configured the two applications to function together, you will notice a slight performance improvement. You now have complete Web server functionality. You can take advantage of the Web server caching and rewriting functionality to test further configurations as required by your application.
|Code sample||IHS_Sample.zip||28 KB|
- Search engine ooptimization: Improving findability with a configurable URL tag library
- WebSphere Commerce discussion forum
- IBM WebSphere Application Server evaluation versions
Dig deeper into WebSphere on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.