This scenario discusses how to configure ASF Tomcat to use an in-process
JSP.
Important: Information
for this topic supports the latest PTF levels for HTTP Server for i5/OS .
It is recommended 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
http://www.ibm.com/servers/eserver/iseries/software/http/services/service.htm for more information.
Scenario
The JKL Toy Company (a fictitious company)
wants to take an existing Java™ server page (JSP) named date.jsp and
enable it to run in-process using the ASF Tomcat servlet engine with the HTTP
Server (powered by Apache). The Basic ASF Tomcat Server wizard is used
to modify the existing Web server configuration called JKLTEST and
create new workers.properties, server.xml, and web.xml configuration files.
Start the IBM® Web Administration for i5/OS™ interface
- Start a Web
browser.
- Enter http://[iSeries_hostname]:2001 in the location or URL field
.
Example: http://jkl_server:2001
- Click IBM HTTP
Server for iSeries.
Set up ASF Tomcat for your HTTP Server (powered by Apache)
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server (powered by Apache) from the Server list.
Example:
JKLTEST
- Select Global configuration from the Server area list.
- Expand HTTP Tasks and Wizards.
- Click Servlet and JSP Enablement.
- Click Next.
Note: If you have used the Servlet and JSP Enablement wizard
prior to this scenario, the wizard will reset all values to the wizard default.
Click Next to continue.
- Select I want to use a servlet or Java Server Page (JSP), and I either
already have them or will provide them later.
- Click Next.
- Select I want to use a Java Server Page (JSP). I already have a JSP
file or will provide it later.
- Click Next.
- Click Finish.
Place your JSP file in the Web applications directory
Using
a file transfer method such as iSeries™ Navigator, Netserver mapped drives,
or FTP, transfer your JSP file to your HTTP Server (powered by Apache) /www/[server_name]/webapps/app1/ directory.
Example:
/www/jkltest/webapps/app1/
Note: All Java servlet class files supporting
the JSP should be placed in
/www/[server_name]/webapps/app1/WEB-INF/classes/ directory.
Example:
/www/jkltest/webapps/app1/WEB-INF/classes/
Restart your HTTP Server (powered by Apache)
Select
one of the following methods below:
Manage one server
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server from the Server list.
- Click the Stop icon if the server is running.
- Click the Start icon.
Manage all servers
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select All Servers from the Server list.
- Click the All HTTP Servers tab.
- Select your HTTP Server name in the table.
Example: JKLTEST
- Click Stop if the server is running.
- Click Start.
Note: If your HTTP Server (powered by Apache) does not start, see
Troubleshoot.
Test your HTTP Server (powered by Apache)
- Start a new Web browser.
- Enter http://[iSeries_hostname]:[port]/app1/[JSP_name.jsp] in the
location or URL field.
Example: http://jkl_server:1975/app1/date.jsp
Your JSP file will be displayed.
View your HTTP Server (powered by Apache)
configuration
Your configuration will look similar if you used the
given example in this and previous examples.
- Click the Manage tab.
- Click the HTTP Servers subtab.
- Select your HTTP Server (powered by Apache) from the Server list.
Example:
JKLTEST
- Expand Tools.
- Click Display Configuration File.
LoadModule jk_module /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM
Listen *:1975
DocumentRoot /www/jkltest/htdocs
ServerRoot /www/jkltest
Options -ExecCGI -FollowSymLinks -SymLinksIfOwnerMatch -Includes -IncludesNoExec -Indexes -MultiViews
HotBackup Off
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{Cookie}n \"%r\" %t" cookie
LogFormat "%{User-agent}i" agent
LogFormat "%{Referer}i -> %U" referer
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log combined
SetEnvIf "User-Agent" "Mozilla/2" nokeepalive
SetEnvIf "User-Agent" "JDK/1\.0" force-response-1.0
SetEnvIf "User-Agent" "Java/1\.0" force-response-1.0
SetEnvIf "User-Agent" "RealPlayer 4\.0" force-response-1.0
SetEnvIf "User-Agent" "MSIE 4\.0b2;" nokeepalive
SetEnvIf "User-Agent" "MSIE 4\.0b2;" force-response-1.0
JkWorkersFile /www/jkltest/conf/workers.properties
JkLogFile /www/jkltest/logs/jk.log
JkLogLevel Error
JkMount /app1/* inprocess
JkMount /servlet/* inprocess
<Directory />
Order Deny,Allow
Deny From all
</Directory>
<Directory /www/jkltest/htdocs>
Order Allow,Deny
Allow From all
</Directory>