JK Connector for Tomcat on IIS 7.5

There are many ways to setup proxy server for Agile File Server. Apache HTTP Web Server, IIS or hardware Load Balancer. If you already have IIS as Proxy for Agile Application Server, then you are fine to install JK Connector on IIS to support Agile File Server, no need to setup other Proxy servers. This document will show how to configure JK Connector on IIS as proxy to service backend Agile File Server. It is also a practical instruction for non-Agile users on how to setup JK Connector 1.2.37 for Tomcat 7.x on IIS 7.5 (Windows 2008R2).

Platform

We have below platform information.

OS: Windows 2008 R2 64 bit
IIS: 7.5
Apache Tomcat Version 7.0.26
Tomcat Connector: 1.2.37

We expect the backend Tomcat server to be http://tomcat.internal.com:8080/Filemgr/ , external users to access it from http://server.company.com/Filemgr/ .

JK Connector Properties

First we create workers.properties file in the JK Connector directory.

## workers.properties
worker.list=ajp13,wlb,jkstatus
worker.ajp13w.type=ajp13
worker.ajp13w.host=slag9320w8-4.sl.agilesoft.com
worker.ajp13w.port=8009
worker.wlb.type=lb
worker.wlb.balance_workers=ajp13w
worker.jkstatus.type=status

And create uriworkermap.properties. In this file, we input the App Context here like Filemgr, webdav. Be sure /jkmanager is present

## uriworkermap.properties
/Filemgr/*=wlb
/webdav/*=wlb
/webdav=wlb
/jkmanager=jkstatus

Create the third file isapi_redirect.properties in same directory

## isapi_redirect.properties
extension_uri=/jakarta/isapi_redirect.dll
worker_file=C:\IISProxy\Connector\workers.properties
worker_mount_file=C:\IISProxy\Connector\uriworkermap.properties
log_file=C:\IISProxy\Connector\isapi_redirect_out.log
log_level=trace

For research purpose, I set log_level to be "trace" . You can set to "error" to supress too much trace data recorded in this isapi_redirect_out.log file.

Now go back to remote Tomcat machine, make sure AJP/1.3 is present in server.xml file, and the port number is exactly same as the one in workers.properties.


IIS Configuration

1. Below we need to manually configure on IIS. First we go to the Server in IIS, go to "ISAPI and CGI Restrictions", add "ISAPI or CGI path". Check "Allow extension path to execute" checkbox.


2. Go to Web Site, in "ISAPI Filters", add a new "ISAPI Filter"


3. In the same Web Site, create a Virtual Directory, make sure Alias is lowercase.


4. Go to "Handler Mappings", click link of "Edit Feature Permissions", select all of "Read", "Script" and "Execute" checkboxes.


5. Exit IIS Manager, restart Control Panel || Services || "World Wide Web Publishing Service", then open IIS Manager again, restart Server and Web Site

6. Make sure you can access both below links from browser.

http://tomcat.internal.com:8080/Filemgr/ 
http://server.company.com/Filemgr/

Troubleshooting

1. If the Proxy server does not work, and no isapi_redirect_out.log generated, then issue below command to see if the DLL is loaded. If not, you may have re-configure above steps from scratch.

C:\>tasklist /m isapi*
Image Name                     PID Modules
========================= ======== =============================
w3wp.exe                      4920 isapi.dll, isapi_redirect.dll

2. If isapi_redirect_out.log is generated, you can research it, find any errors and fix it, yourself, by using Google.



Comments:

I used the BonCode Open Source connector for IIS (tomcatiis.riaforge.org). It does not block non-related requests, e.g. static content and has fewer conflicts especially if you use IIS as a portal for multiple applications. In addition it seemed much simpler to install and manage and does not require "magic" virtual directories.

Posted by Garry on November 22, 2013 at 11:27 PM CST #

Garry,
Thanks for your sharing.

Jie

Posted by Jie Chen on December 02, 2013 at 08:08 PM CST #

Post a Comment:
  • HTML Syntax: NOT allowed
About


Jie Chen is the L3 memeber in Oracle Agile Support.
This blog focuses on the Maintenance, Diagnosis and Tuning related technical skills.
The technology covers Java/JavaEE, Weblogic, Security, Clustering, and Database of course.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today