This is a guide to setting up the IIS web server to forward requests to the Apache Tomcat server.
These instructions assume that Tomcat 6.0 has been freshly installed. Visit http://tomcat.apache.org/ to download the installation file.
Contents
1 Tomcat Configuration Changes
1.1 /conf
1.2 Redirector dll
2 IIS Configuration Changes
2.1 Add new virtual directory
2.2 Add isapi filter
2.3 Additional change for IIS 6.0
2.4 Restart IIS
3 Load Balancing and Failover
4 LambdaProbe Monitoring
Tomcat Configuration Changes
Changes are by directory. "/" refers to %CATALINA_HOME%, e.g. C:\apache-tomcat-6.0.18
/conf
Edit the server.xml here and another connector, directly after the existing (connector ... /) tag ie... connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" URIEncoding="UTF-8" /
Note that if you used the windows installer, the connector should already be there.
Redirector dll
Copy the isapi_redirect.dll and isapi_redirect.properties file from IT Share to your /bin folder. Right click on the .dll and choose "Properties". If there is a warning that says, "This file came from another computer and might be blocked to help protect this computer.", click "Unblock".
Edit the isapi_redirect.properties file to adjust the log file, worker file, worker mount file, and rewrite rule file location.
Copy the default workers.properties, uriworkermap.properties and rewrites.properties files from IT Share to your /conf folder
See http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html for more information about the properties files.
IIS Configuration Changes
Add new virtual directory
Using the IIS management console, add a new virtual directory to your IIS web site. The name of the virtual directory must be jakarta. Its physical path should be the directory where you placed isapi_redirect.dll. While creating this new virtual directory assign it with execute access.
Add isapi filter
Using the IIS management console, add isapi_redirect.dll as a filter in your IIS web site. The name of the filter should reflect its task (I use the name tomcat), its executable must the isapi_redirect.dll.
Additional change for IIS 6.0
If you're using IIS 6.0 you must also do the following: Using the IIS management console, add the Jakarta Isapi Redirector to the Web Service Extensions.
Right-click on Web Service Extensions and choose Add a new Web Service Extension.
Enter tomcat for the Extension Name.
Add the isapi_redirect.dll to the required files.
Check the Set extension status to Allowed.
Click on OK.
Restart IIS
Restart IIS (stop + start the IIS service), make sure that the tomcat filter is marked with a green up-pointing arrow.
That's all, you should now start Tomcat and ask IIS to serve you the /examples context. Try http://localhost/examples/jsp/index.html for example and execute some of the JSP examples.
Load Balancing and Failover
Load balancing and failover can be easily achieved by configuring a load balancer worker in the worker.properties file. For instance, to have default load balancing and failover with 2 Tomcat server, you need to make the following changes:
# Workers to be created
worker.list=loadbalancer,worker1,worker2
#
# Worker #1 on first host
#
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=1
#
# Worker #2 on second host
#
worker.worker2.type=ajp13
worker.worker2.host=bloak-sbhatia.broadlane.com
worker.worker2.port=8009
worker.worker2.lbfactor=1
#
# Load Balancer worker
#
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=worker1,worker2
worker.loadbalancer.method=B
See http://tomcat.apache.org/connectors-doc/generic_howto/workers.html for more information about how to configure workers.
Worker reference's guide: http://tomcat.apache.org/connectors-doc/reference/workers.html
LambdaProbe Monitoring
A very good tool to monitor Tomcat is LambdaProbe, which can be downloaded free from the following site:
URL : http://www.jstripe.com/d/index.htm
Sample Dev Env. URL for Probe: http://bloaksupali03:8180/probe with username/password as admin/broadlane
No comments:
Post a Comment