Setting up JSP files for out-of-process ASF Tomcat server with HTTP Server (powered by Apache)
This topic provides information about how to set up a JavaServer Page (JSP) file for use with the Tomcat servlet engine with the Web Administration for i5/OS interface.
Information for this topic supports the latest PTF levels for HTTP Server for i5/OS . IBM recommends that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See IBM Service for more information.
Follow the instructions to use a JSP file with out-of-process ASF Tomcat servlet engine on your HTTP Server (powered by Apache).
Before you begin, review the User profiles and required authorities for HTTP Server topic.
Parent topic:
Tomcat tasks
Setting up the out-of-process ASF Tomcat server
- Click the Manage tab.
- Click the ASF Tomcat Servers subtab.
- Expand Tomcat Tasks and Wizards.
- Click Create ASF Tomcat Server.
- Enter a name for your server in the ASF Tomcat server name field or accept the default name provided.
- Click Next.
- Accept the default value (QTMHHTTP) or enter a specific user id in Server userid. Your ASF Tomcat server runs under the authority of the user id you specify.
- Accept the default value for Java version (JDK). JDK 1.3 is the only valid option for ASF Tomcat servers on i5/OS™ V5R4. Prior versions of the operating system support JDK 1.2 also.
- Accept the default value for ASF Tomcat home.
- Accept the default value for Java classpath entries.
- Click Next.
- Accept the default value for IP address. If you specify a particular IP address, ensure that workers for the ASF Tomcat module for HTTP Server (powered by Apache) are configured to communicate specifically using the same IP address.
- Enter a unique port number in the Port field for your server to use. The port you specify must not be used by any other server on your system.
- Select Binary (AJP13) for Server type.
- Click Next.
- Click Add.
- Enter the name of your JSP file with a forward slash "/" before it and .jsp after for URL path. For example, /myjsp.jsp.
- Enter webapps/app1 for Application base directory.
Do not select the Reloadable option.
- Click Continue.
You might receive the following warning:
Cannot find a WEB-INF/web.xml configuration file under the application base directory /ASFTomcat/ENGINE1/webapps/app1. Use the "Configure" button to create one, unless you will be installing a .jsp or .war file.This warning can be ignored, because a JavaServer Page (JSP) can be added to your server in the next section.
- Click Next.
- Click Finish.
- Click OK.
Placing your JSP file in the correct directory
Using a file transfer method such as an iSeries™ NetServer™ mapped drive or FTP, copy your JSP file to the following directory: /ASFTomcat/yourserver/webapps/app1/jsp, where yourserver is the name of the server you created in the previous section.
Setting up the ASF Tomcat module for HTTP Server (powered by Apache)
- Start the Web Administration for i5/OS interface.
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server (powered by Apache) from the Server list.
- Select Global configuration from the Server area list.
- Expand Server Properties.
- Click ASF Tomcat Setup task from the task list.
- Select the Enable servlets for this HTTP Server option.
- Accept the default workers definition file provided.
- Click Next.
- De-select the Enable an 'in-process' servlet engine option (selected by default), and select the Enable 'out-of-process' servlet engine connections option.
- Click Add.
- Accept the default value, worker1, for the Worker name field.
- Accept the default value, Binary (AJP13), for the Worker type field.
- Enter information for the Hostname:Port field based off one of the following conditions:
- If your out-of-process ASF Tomcat server is on the local iSeries system, select its hostname and port from the drop-down list.
If you set up your local ASF Tomcat server to use "Any Address", it is best to have the worker use the localhost address (127.0.0.1). However, if you specified a particular IP address for your ASF Tomcat server, ensure that the worker also uses the same address, which may or may not be the localhost address (127.0.0.1).
- If your out-of-process ASF Tomcat server is on a remote system, enter its hostname and port as in the following example: iseries.ibm.com:8009, or you may specify an IP address and port number instead of a hostname and port number (10.9.8.7:8009).
If you set up your remote ASF Tomcat server to use a particular IP address, ensure that the worker also uses the same address.
- Click Continue.
- Click Next.
- Click Add.
- Enter /app1/* for URL (Mount point).
- Accept the default value for ASF Tomcat worker.
This mount point uses a context match form, which allows any client request with a URI containing /app1/ to be passed to the specified worker. The worker, in turn, forwards the request to the ASF Tomcat server configured for that worker.
- Click Add.
- Enter the name of your JSP file with a forward slash "/" before it and .jsp after for URL (Mount point). For example, /myjsp.jsp.
- Accept the default value for ASF Tomcat worker.
This mount point uses an exact match form, which allows any client request containing a URI specifically for your JSP to be passed to the specified worker.
- Click Add.
- Enter /app1 for URL (Mount point).
- Accept the default value for ASF Tomcat worker.
This mount point uses an exact match form, which allows any client request containing a URI specifically for /app1 to be passed to the specified worker. This mount point is different than the first one (added previously) in that the URI must not contain an ending slash ('/').
- Click Continue.
- Click Next.
- Click Finish.
- Click OK.
Starting HTTP Server and out-of-process ASF Tomcat server
- Click the Manage tab.
- Click the All Servers subtab.
- Click the All HTTP Servers tab.
- Select your HTTP Server (powered by Apache) from the table.
- Click Start.
- Click the All ASF Tomcat Servers tab.
- Select your out-of-process ASF Tomcat server from the table.
- Click Start.
Testing your configuration
- Start a Web browser.
- Enter http://yourserver:port/app1/jsp/yourjsp.jsp, where yourserver:port is the hostname and port of your HTTP server and yourjsp.jsp is the name of your JSP file.