IIS and Tomcat - how to configure to work together

By: Emiley J. Emailed: 1700 times Printed: 2205 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

This tutorial explains how to configure your IIS (in this example IIS 5.0, since I have not upgraded yet) and Tomcat 4.1 xxx version (again since I have not upgraded yet). But the concept should be the same. So if you want to host some JSP files or servlets on your Tomcat which is installed in port 8080 and your IIS is installed on the same machine at port 80 and you want to direct all JSP files also to port 80 so that IIS can forward these queries to tomcat internally and respond. So the user does not have to type 8080 on the url. Well if you want to do that then these are the steps.

INSTALL IIS REDIRECTOR FOR TOMCAT: 

A. In Windows Explorer, navigate to <drive>:\Tomcat4112\bin. 

B. Within the 'bin' folder, create a new folder and name it 'win32'. 

C. Download the isapi_redirector.dll. file. (search the net for this file and you can download)

D. Save the isapi_redirector.dll file into <drive>:\Tomcat4112\bin\win32. 

Note that the spelling of the required file is isapi_redirector.dll. Jakarta-Tomcat 3.x.x used a different file called isapi_redirect.dll; this file is not compatible.


DOWNLOAD PROPERTIES FILES: 

E. Download the worker.properties file. 
(you can search the net to get a sample)

F. Open an empty document in Notepad. Copy and paste the contents of the worker.properties file into the empty document. 
 

You must use Notepad to edit the properties files. Using other text editors for this step may cause a '404 Error, File not found' later in the installation.


G. Ensure that the 'java_home' and 'tomcat_home' variables have been set correctly. For example: 

worker.tomcat_home=<drive>:\Tomcat4112

worker.java_home=<drive>:\j2sdk1.4.0

 Ensure that these paths accurately reflect your current set-up environment.


H. Save the file in <drive>:\Tomcat4112\conf folder as "worker.properties", quotes included, and specify 'All File Types' before saving. 

I. Download the uriworkermap.properties file. 
(search the net for a sample)

J. Open an empty document in Notepad. Copy and paste the contents of the uriworkermap.properties file into the empty document. 

Again, you must use Notepad to edit the properties files. Using other text editors for this step may cause a '404 Error, File not found' later in the installation.


K. Save the file in <drive>:\Tomcat4112\conf folder as "uriworkermap.properties", quotes included, and specify 'All File Types' before saving. 

MODIFY WEB.XML FILE 

L. In Windows, navigate to drive>:\Tomcat4112\conf, and open the file 'web.xml' in a text editor. 

M. Search for the following text: 

    <!-- The mapping for the invoker servlet -->

<!--

<servlet-mapping>

    <servlet-name>invoker</servlet-name>

    <url-pattern>/servlet/*</url-pattern>

</servlet-mapping>

-->

N. Delete the comment lines "<!--" and "-->", so the code looks as follows: 

    <!-- The mapping for the invoker servlet -->



<servlet-mapping>

    <servlet-name>invoker</servlet-name>

    <url-pattern>/servlet/*</url-pattern>

</servlet-mapping>




O. Save the file, and exit. 

CREATE JAKARTA VIRTUAL DIRECTORY: 

Q. Open Internet Services Manager. 

R. In the left panel of the Console, under Internet Information Services, expand the contents for your "*host" machine name. 

S. Right-click 'Default Web Site' and select New > Virtual Directory. This opens the Virtual Directory wizard. Continue as follows: 
S1. Click Next to continue. 
S2. In the Alias box, type 'Jakarta' and click Next. 
S3. For Directory, browse to: <drive>:\Tomcat4112\bin\win32, click OK, then click Next. 
S4. Check the box to give the permissions: Execute (such as ISAPI applications or CGI).
S5. Click Finish. 

T. Right-click 'Default Web Site' and select Properties. Continue as follows: 
T1. In the dialog box, select the 'ISAPI Filters' tab. 
T2. Click Add. 
T3. In the Filter Properties dialog box, enter the Filter Name such as Jakarta. 
T4. For the Executable, browse to <drive>:\Tomcat4112\bin\win32\isapi_redirector.dll and click OK. 
T5. Click Apply and close the Default Web Site Properties dialog box. 

U. Stop and Start IIS, ensuring that the Default Web Site is selected. 

V. Return to the ISAPI Filters tab and ensure that there is a green, upward arrow next to the Jakarta filter. Close Internet Services Manager. 

If there is not a green arrow next to Jakarta filter, try stopping and re-starting the 'IIS Admin Service', including the WWW Publishing Service, from the Services panel. If the Jakarta filter still fails, do not proceed further. Go back and check the registry entries created in Step G.

VERIFY TOMCAT INSTALLATION: 

W. Open the Services panel. Select the Apache Tomcat 4.1 service from the list and start it, if not already started. 

X. Enter the following into a browser. Note: This is case sensitive. 

http://<your_machine_name>/examples/servlet/HelloWorldExample

A page should display that says "Hello World" if the test is successful. 

If this test fails, recheck your installation steps. You may find that this URL works if you specify 'port 8080'. This only indicates that the Tomcat web server is working; the required redirect to IIS is failing.

JSP Home | All JSP Tutorials | Latest JSP Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

You should check out the new BonCode connector for IIS instead of the isapi one. http://tomcatiis.riaforge.org
It is much simpler.


View Tutorial          By: Petro Donic at 2012-07-16 02:34:06

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Emiley J.
Error generating R.java from manifest
ERROR 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client
IIS and Tomcat - how to configure to work together
PHP Warning: Unknown(): Unable to load dynamic library '/usr/local/php4/lib/php/extensions/no-debug ......
Adding your own Application icon for your J2ME application (jar file)
Creating Menus in Code using VB.net
Traversing all files in a directory using Ruby
Using Proxy to connect to URLs in Ruby
POST a form in Ruby
Reading URL content using Ruby (HTTP)
dRuby client/server mode sample program
Benchmark module in Ruby
encoding and decoding in Ruby using Base64 Module
Module Abbrev in Ruby
Standard Library Packages in Ruby

More Tutorials in JSP
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: `java.net.BindException: Permission denied <null>:80
JSP Alert Example
JSP CheckBox Example
Uploading an Image to a Database using JSP
Uploading a file to a server using JSP
A JSP page that gets properties from a bean
The page Directive in JSP
The taglib, tag, include, attribute and the variable Directive in JSP
Declarations in JSP
Scriptlets and Expressions in JSP
Tag Libraries in JSP
The Request Object in JSP
The Response Object in JSP
The Out Object in JSP
The Session Object in JSP

More Latest News
Most Viewed Articles (in JSP )
What are the different scopes in JSP?
JSP CheckBox Example
The JSP Program running first Time.
Tags using in jsp
Simple HTML-Building Utilities
Retrieving a Portion of a String
Comparison operators in JSP
Automatically Including Preludes and Codas in JSP
The BodyTag Interface in JSP
Encrypting Passwords in Tomcat using Servlets
JSP Example to connect to MS SQL database and retrieve records
Using UTF-8 in JSP / ASP / HTML pages.
Writing your first JSP page
Getting Started with JSP
IIS and Tomcat - how to configure to work together
Most Emailed Articles (in JSP)
What is JSP?
Declaring variable in JSP
A Servlet That Generates HTML
Retrieving a Portion of a String
JSP Example to connect to MS SQL database using Tomcat Connection Pool
The Application Object in JSP
Cookies using JSP or Java Bean
Click to Activate and Use this control
The JSP Program running first Time.
Scriptlets
Server Side Programming
Syntax For JSP Declaratives
Embedding java codes in jsp sciptlets
Tags using in jsp
JSP pages in servlet