Saturday, May 21, 2016

IIS and Tomcat Redirection on Windows Server 2008


Steps necessary to set up an IIS website that will forward the requests to the Application instance hosted on Tomcat application server and provide support for non IIS compatible extensions, which include jsp.

Below steps to follow :


1. Install Jdk 6
Download and install JDK 6 with its default setup options.

2. Install Tomcat 6.0.18
Verify Tomcat setup is working on port 8080.
Now, go to Computer>Properties>Advanced System Settings>Advanced Tab>Environment Variables
Set System Variables (JAVA_HOME and CATALINA_HOME)

3. Setting up Registry value
·        Download the isapi_redirect.dll from the Tomcat site for Windows Server 2008 R2 64 bit from the following URL. http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win64/jk-1.2.28/amd64/
·        Rename the isapi_redirect-1.2.x.dll to isapi_redirect.dll
·        Copy the isapi_redirect.dll to C:\Program Files\Apache Software Foundation\ISAPI\
(above path can be anything, make sure to update any references)
·        Run Regedit as Administrator
·        Find the key [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\

·        Make one new key entry as “Jakarta Isapi Redirector” then another new key entry name “1.0” then under that make 6 new string values.


NOTE: If “Apache Software Foundation” folder does not exist in the hierarchy mention here then create the path manually. So, the hierarchy will resemble the following.
[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]

Registry Key  and  Value
@=
extension_uri = /jakarta/isapi_redirect.dll
log_file = C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\logs\isapi_redirect.log
log_level = error
worker_file = C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\conf\workers.properties.minimal
worker_mount_file = C:\Program Files (x86)\Apache Software Foundation\Tomcat 6.0\conf\uriworkermap.properties

4. Install and Configure IIS Role



Click Next and Finish the installation.
You can check wheter the iis works or not by addressing your browser to http://localhost.

5. Setup isapi & cgi restriction at iis server
·        Open IIS Manager and Select Your Server
·        From the features view open ISAPI and CGI Restrictions, Click Add from the Actions bar
·         For ISAPI or CGI Path click the … Button and choose your isapi_redirect.dll file
·        In the Description Field write “tomcat”
·        Tick the Allow extension path to execute and click OK.



6. Enable isapi filters at iis default website
·        Select Default Website and double click ISAPI Filters to open it. Click Add
·        Enter “tomcat” in the filter name And click …Button to to select the isapi_redirect.dll
·        Click open to select the dll and Ok to close the window when done.



7. Creating Virtual directory and handler mappings
·        Right click to the Default website and choose Add Virtual Directory.
·        Enter “jakarta” in the Alias field and choose the path of the “isapi_redirect.dll” file path.
·        Click ok when done.
·        Now, Open Handler mappings by selecting the virtual directory “jakarta”.
·        Select Edit Feature Permission from the Actions bar and Check All (Read, Script, and Execute) and click OK.






8. Creating properties file
Now create two properties FILE AS follows:
·        Create a file named “workers.properties.minimal
Insert the following lines into this file:

worker.list = worker1
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.type=ajp13
·        Create another file named “uriworkermap.properties” in the same directory. Insert this line and save.

/*=worker1
·        Test and Run
·        Restart the Tomcat Service and the IIS Web-Server
·        Test the configuration by trying to access the iis site (http://localhost),
if you get Tomcat site then you are done successfully.

No comments:

Post a Comment