You are on page 1of 20

Configuring JSP for IIS — The NeoSmart Files Página 1 de 20

SOAP Test Client Send and Recieve SOAP Messages Test your Web Services Today! www.IntegrationCentral.com
Jsp Content Management Java HTML Editor, Rich Text Editor Java Applet Content Editor. www.editlive.com
Cache .NET Session-State Transparent distributed caching scales performance. Free download! www.scaleoutsoftwa

Configuring JSP for IIS


Published July 27th, 2006 in Guides, Software, Windows 82 Comments Tags: IIS, Java, JSP

Many people love the ease and security of using Internet Information Services 6 server on
Windows 2003. Adding PHP and ASP support is a cinch, and in no time at all, IIS 6 can serve
anything you throw at it – except JSP files of course. By no stretch of imagination is getting
JSP running invisibly with IIS 6 an easy job, and here’s the best way to do it.

In this guide, we’ll be using IIS 6 on Windows Server 2003 with SP1 installed, together with
the Tomcat servlet engine (version 5.5.17 stable) to parse the JSP files that IIS may encounter.
It covers all the prerequisites and how to get them up and running.

This guide assumes you already have II6 6.0 configured and running 100% with everything all
right and trouble-free, and assumes Tomcat (and it’s prerequisites) isn’t already installed. Here
goes..

Install JVM

Tomcat is a Java servlet, and requires the presence of Sun’s JDK to run. You can grab the Java
EE 5 JDK off of Sun’s servers. Start the installer, make sure the J2EE Development Kit is
selected if you’re doing a custom install, and let it finish.

If you installed it using the default settings, it should have installed the JDK files to
“C:\Program Files\Java\jdk1.5.0_06” or something close to it, depending on the version you
installed. Make sure you also let it install the JRE, you’re going to need it later. Write down or
otherwise memorize the JDK location you used, it’s important.

Download and Install Tomcat

Grab Tomcat 5.5.x from the Apache Software Foundation’s website here. Download the latest
entry under Binary Distributions -> Core. For quickest deployment, make sure to download
the .exe file rather than the zip package. Run the exe, select “Full Install” and let it save to the
default location (C:\Program Files\Apache Software Foundation\Tomcat 5.5), herein referred
to as $CATALINA_HOME. It will ask for the JRE/JDK location, you will need to input the
value you copied down earlier and continue.

When the setup finishes, start the service and continue. To test if it installed OK, direct your
browser to http://localhost:8080/, assuming everything has gone well (no reason it shouldn’t),
you should get the stock Tomcat welcome page – now that Tomcat is up and running all
what’s left is to make it play nice with IIS..

IIS Configuration

The Jakarta/Tomcat project has lent itself to the creation of an excellent set of plugins and dlls:
the Tomcat Connectors. The one we’re looking for hooks straight into IIS and is called
‘isapi_redirect*.dll’ where the ‘*’ is the version number. Head over to the Tomcat distribution
site and grab the latest version of isapi_redirect.dll.

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 2 de 20

Once you have isapi_redirect*.dll, copy it to $CATALINA_HOME/bin/isapi_redirect.dll.


Download isapi_redirect.properties to that same directory. You may need to tweak this file (in
WordPad) if you installed Tomcat to a non-standard directory.

Download workers.properties and uriworkermap.properties and copy them to the


$CATALINA_HOME/conf directory. You should probably open then in WordPad and double
-check their contents against your directory locations for posterity's sake.

Open the IIS management MMC, and right-click the default website -> Properties -> ISAPI
Filters. From there proceed to add a filter called ‘isapi_redirect’ that points to
$CATALINA_HOME/bin/isapi_redirect.dll. Apply changes and close the dialog.

Right-click the default website again, and this time add a “Virtual Directory” called
‘jakarta’ (without the quotes!) that points to $CATALINA_HOME/bin/ (the same place as
isapi_redirect.dll). Give it ‘execute’ privileges when prompted. You need to set permissions on
the the files we’ve just modified/created in order for the filter to work.

Next you need to tell IIS that these files are a-OK, and that it’s safe to run them. In the IIS
management center again, click “Web Service Extensions” -> “Add a new Web service
extension..” For ‘extension name’ enter “JSP” and for the executable file, locate
$CATALINA_HOME/bin/isapi_redirect.dll, check “set this extension to allowed”, and then
press OK.

Time to restart IIS. Stop it and start it again or just use the quick restart manager. To test
Tomcat’s integration with IIS, point your browser to http://localhost/jsp-examples/ and if
everything went all right… you’re done!

Configuring the Redirects

Remember the file you downloaded? “uriworkermap.properties?” That’s where you have to
define the subdirectories in $CATALINA_HOME/webapps directory. For example, the file
you downloaded had the “jsp-examples” context already defined./jsp-
examples/*=neosmart tells it to transfer any calls to localhost/jsp-examples to a Tomcat
configuration that you downloaded earlier called 'neosmart.'

Adding more contexts is easy — once you’ve successfully configured Tomcat to run whatever
webapp/jar file you want it to, (and that application is now successfully running on port 8080),
simply add an entry /mycontext/*=neosmart where ‘mycontext’ is obviously the name of the
webapp (the subfolder) you’re trying to configure.

But in order to get it to completely act as a natural directory within IIS, you have to add
another virtual directory. You can point it wherever you like, but you must have a virtual
directory named the same thing as the context (for instance, if you have
http://localhost:8080/jspBB/ you would create a virtual directory called jspBB in IIS). That’s
to ensure that calls to http://localhost/jspBB work just as well as http://localhost/jspBB/ (note
the end-backslash).

That’s it, you’re done! You know have a port-free address that redirects all calls invisibly and
silently to Tomcat, the power, advanced features, and security of IIS with the added flexibility
of Java Server Pages!

It’s Still not Working?

If it seems it’s still not working, i.e. you can view the pages via TomCat (by entering the port
in the URL) but not by using IIS, try this:

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 3 de 20

The files you download are text files (obviously) with certain configuration bits in them. Open
each one and check some of the values. Many contain paths to TomCat and the JDK: make
sure the same paths that are in the file are the same as your configuration. Ensure that all of the
paths work, there are no typos, and that all the files are present and in the right directory. If it
still doesn’t work, http://neosmart.net/forums/ is the place to go. No support requests in the
blog please!

Leave a Reply • About to Ask for Help? • Subscribe to Our Feed

82 Responses to “ Configuring JSP for IIS ”

1 Burak Geris
Aug. 9th, 2006 at 6:52 pm

Thanks for this clear article.


I have a virtual server that has exactly same configuration with above. I cannot get
success after step by step configuration. When I request a mapped uri, the response is
404 everytime and Windows event log has error record about that isapi filter could not
be loaded.

Is the problem could be Virtual Server?

> You need to set permissions on the the files we’ve just modified/created in order for
the filter to work.
Could you explain about permission settings more exactly please? Maybe the problem is
that.

Best Regards.

2 Mahmoud Al-Qudsi
Aug. 9th, 2006 at 7:14 pm

Right-click the DLL and add iusr_COMPUTERNAME as a user with read privellages.

3 Rob
Aug. 14th, 2006 at 3:54 pm

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 4 de 20

I have followed the directions as stated, but still get 404 Not Found.
I am not sure what you mean by this statement "to a Tomcat configuration that you
downloaded earlier called ‘neosmart'". What configuration are you referencing?
Workers.properties?

4 Arivuvel Ramu
Aug. 28th, 2006 at 10:02 am

Thank Friends,

This is what i'm expected for long back. Now Jsp & IIS Integration makes one
Milestone.

Now Our client can use the IIS Security and Tomcat Servlet engine features together.

Thank you.

Arivuvel Ramu

5 Mahmoud Al-Qudsi
Aug. 28th, 2006 at 10:13 am

You're welcome!!

6 Marcio
Aug. 29th, 2006 at 3:22 pm

Thanks for the great article, however I'm facing a little problem.

I followed all the instructions, but when I open a browser and call for http://localhost/jsp
-examples/ I get the error 404.

When I access the http://localhost:8080/jsp-examples/ everything works fine.

I gave all the privelegies but couldn't solve the problem. Please could you give me some
help.

Thanks in advance

Marcio

7 Mahmoud Al-Qudsi
Aug. 29th, 2006 at 10:07 pm

My best guess is that you didn't follow this step:

[quote post="229"]Adding more contexts is easy — once you’ve successfully


configured Tomcat to run whatever webapp/jar file you want it to, (and that application
is now successfully running on port 8080), simply add an entry

/mycontext/*=neosmart
where ‘mycontext’ is obviously the name of the webapp you’re trying to configure
[/quote]

8 Harmeet
Sep. 14th, 2006 at 1:28 pm

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 5 de 20

I've got a question, I'm running a website that has the .jsp file at the root of the website's
directory. When trying to load up the site, it gives me "The specified module could not
be found."

Any suggestions?

Harmeet

9 waterlooguy
Sep. 14th, 2006 at 5:14 pm

Hello,
I am having the same problem. I can access the jsp pages from tomcat but when i do
through IIS i get 404 error.

thats my uriworkermap.properties file.


/jsp-examples/=neosmart
/WebApplication8/=neosmart

you did not mention, changing the registry any where in this article. is that allright?

thanks

10 Mahmoud Al-Qudsi
Sep. 19th, 2006 at 2:13 pm

[quote comment="5410"]I've got a question, I'm running a website that has the .jsp file
at the root of the website's directory. When trying to load up the site, it gives me "The
specified module could not be found."

Any suggestions?

Harmeet[/quote]

In your case it seems that either the path to isapi_redirect.dll is incorrect, or you haven't
given the proper permissions to the DLL.. Check both and post back :)

@Waterlooguy:
There are no registry changes to be made, but your bug can be solved following my
comment above:
You apparently haven't added "*.jsp" as an allowed extension for IIS 6...
Refer to where the article says: [quote]Next you need to tell IIS that these files are a-
OK,[/quote] and do that step....

11 DaNuGai
Sep. 21st, 2006 at 2:49 pm

Hello,

These are very good directions. I have couple questions though. Before I ask my
question, I just want to show how I have everything setup.

It's pretty much the same as above expect I didn't download Examples and
Documentation during Tomcat setup. I created "SampleWebApps" directory under "C"
drive and "SampleWebApps.xml" under $CATALINA_HOME\conf\Catalina\localhost.
Then, I tested Tomcat by http://localhost:8080/SampleWebApps and it works fine.

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 6 de 20

I also added this "/SampleWebApps/*=neosmart" to "uriworkermap.properties"

Now my question is, how do I link HTM, HTML, and ASP files to my JSPs. My JSPs
are located under "C:\SampleWebApps\" and my other files are located under
"C:\Inetpub\wwwroot". I tried creating a hyperlink to
"http://localhost:8080/SampleWebApps" but it didn't work from another computer.

I then created a "test.jsp" under "C:\Inetpub\wwwroot" and created a link from


"index.html" to "test.jsp" but when I type "http://servername" it's taking me right to the
JSP. I don't see the "index.html"

I would really appreciate some help.

12 DaNuGai
Sep. 21st, 2006 at 3:32 pm

By the way, when I type "http://servername/index.jsp" I get a 404 error. I know you
mentioned that "Next you need to tell IIS that these files are a-OK" but how do I do that
physically. I followed the steps in the above instruction very carefully.

Again, I really appreciate your help.

13 DaNuGai
Sep. 21st, 2006 at 3:34 pm

I did do the following if this is what you are refering to when you say “Next you need to
tell IIS that these files are a-OK”

In the IIS management center again, click “Web Service Extensions” -> “Add a new
Web service extension..” For ‘extension name’ enter “JSP” and for the executable file,
locate $CATALINA_HOME/bin/isapi_redirect.dll, check “set this extension to
allowed”, and then press OK.

14 adjhan
Sep. 26th, 2006 at 9:47 am

I have the same problem. I added the filter in the IIS MMC but the status is not loaded. I
also added the virtual directory and allowed the filter to web service extension. the
http://localhost:8080 is working and IIS is also working. But the http://localhost/jsp-
examples/ is not working.

What could be the problem? Why my filter is not loaded? Thanks.

15 DaNuGai
Sep. 26th, 2006 at 1:00 pm

Adjhan,

Try http://localhost:8080/jsp-examples.
I am not sure what the problem is either? Actually, I am not even sure how to connect
JSPs with IIS or how link them?

16 adjhan
Sep. 27th, 2006 at 12:37 am

Dan,

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 7 de 20

Port 8080 under tomcat is working for me. It's just when I use port 80 for IIS. My
isapi_filter is not loaded in IIS. I don't know why? And the jsp-examples is not working
either. But my html and php pages are working very well in IIS.

From the tutorial mentioned J2EE SDK must be installed, I installed JRE only. Is that
ok?

17 DaNuGai
Sep. 28th, 2006 at 5:17 pm

Try changing your port for Tomcat.

http://www.coreservlets.com/Apache-Tomcat-Tutorial/#Change-Port

Not sure if this will help.

Also, do you know how how I will be able to use Tomcat with IIS? In nother words,
how would I be able to provide a hyperlink from one to the other? You see how I have
everything setup above.

18 waterlooguy
Oct. 11th, 2006 at 5:57 pm

thanks for the help guys.

19 Mahmoud Al-Qudsi
Oct. 11th, 2006 at 8:32 pm

You're welcome... I hope this means you're all set and everything is working right?

20 2revup
Oct. 19th, 2006 at 5:26 am

This like all other instructions i have read do not work i can call all my jsp applications
through localhost:8080/myapp etc but IT will NOT pass this through IIS, and its very
very painful, i have been on this for 2 weeks and have gotten no further. Any help would
be greatly appreciated.

21 Mahmoud Al-Qudsi
Oct. 19th, 2006 at 5:49 am

One of the files on our server had some extra information in it that caused some trouble
for a lot of setups, we've fixed it now though.

We also added a section in the "configuring new contexts" bit, that should help some
people that could get the examples working but not their own contexts.

I've personally installed Windows 2003 Server in VMware from scratch just to test this
guide as it is at the moment: it works perfectly. Crystal.

Please check the new "If it still doesn't work" section, that should be very helpful, and I
believe that is where most of the issues arise.

Also, please redownload all the .properties files, as we mentioned there was some extra
stuff that didn't help.

22 Koinoor

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 8 de 20

Feb. 12th, 2007 at 4:51 pm

Anyone configure IIS 7 + TOMCAT for JSP and servlet ?

Please help me.

23 skv
Apr. 27th, 2007 at 8:51 am

I'm trying to configure Tomcat 5.5 with IIS6 on Win 2003.


I read a lot of documentation, and I followed your step-by-step guide too, but it doesn't
work for me.

This is the problem: when I request a servlet or a JSP I get a 404 error. If I request a
normal HTML file, there isn't any problem.

I have the green arrow, the "web service extension" is allowed, the isapi_redirect is the
latest version (but I tried also an older version), I have the "jakarta" virtual directory
configured properly, I have the "example" virtual directory configured properly, I copied
the DLL in /bin (but I tried with /bin/win/i386 and with /conf, obviously changing the
path on IIS configuration), in the tomcat/logs/isapi.log there isn't any error, I tried the
IIS 5 isolation mode too (without any success).

What can I do? Any suggestion?

24 Mahmoud Al-Qudsi
Apr. 27th, 2007 at 9:35 am

Check the permissions on the DLL.

25 skv
Apr. 27th, 2007 at 11:33 am

Thank you for your fast reply.

I forgot to write that I checked the permissions: everyone can "Read" and "Read &
Execute" the DLL.

26 Mahmoud Al-Qudsi
Apr. 27th, 2007 at 11:54 am

No support requests in the blog please -> http://neosmart.net/forums/

Thanks!

27 Adrian
May. 4th, 2007 at 6:29 pm

Been over this exercise again and again but still getting a 404!

Help!!

28 Narco
May. 17th, 2007 at 9:04 am

Logged in user problem.. in my jsp i need to know how is the logged in user
authenticated by IIS integrated security, is there a method ?

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 9 de 20

For example:

get /security/access.asp

<- insert login/password ->

<- authentication ok ->

get /MyVirtualJsp/test.jsp (here i have no header or reaquest.getRemoteUser() that


works ??? )

29 smitty
Jun. 23rd, 2007 at 2:52 am

IIS 6 and Tomat

The easiest way to Setup the JK connector is to get the 1.2.14 version first and use the
msi included) upgrade later by downloading the jk.1.2.23 dll file

Edit the workers.properties.minimal and uriworkermap.properties and Windows


Registry as needed

Add Server Side Includes in IIS 6

Allow the JK isapi_redirect.dll in IIS as an allowed web service (ISAPI won't show
"green" until site is visited)

Edit \config\server.xml... look for or add something like this to your file. This refers to
your JK connector configuration.

<Connector port="8009" enableLookups="false" acceptCount="100"


maxThreads="256" minSpareThreads="25" maxSpareThreads="75"
connectionTimeout="20000" redirectPort="8443" protocol="AJP/1.3" />

For IIS you sometimes need to enable "asset externalization" in one of Tomcat's config
files like product.properties. Also, somethimes just a virtual directory to Images, and
another to content will do.

30 Steve
Jul. 4th, 2007 at 6:46 pm

what if i already have a website container that i want to use.

I have currently a website container with 6 domains in it with php. asp and other
technologies integrated. The website container is custom on another hard drive "not
inetpub" How could i get Tomcat to handle the java proccessing of any of those
websites without forcing to make websites in its own directories.

31 smitty
Jul. 10th, 2007 at 1:05 am

Steve,

The App Dir's don't have to be in the Inetpub folder.

You can use a redirect to the appropriate web site's IP or virtual dir and have those
redirects stored in the inetpub

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 10 de 20

Smitty

32 Steve
Jul. 10th, 2007 at 2:37 am

I dont even use Inetpub.

I use a custom wwwroot on the D drive.

TO be honest i dont think java will be around too much longer. Everyone is going php
and i can see why nowadays.

Sun Microsystems has failed to keep integrating Java technologies up to date on


Windows Servers and make the integration process on the fly. Its pretty bad when a
server admin has to uninstall the latest version of a techonology and load a version 4
years older with all kinds of security holes and problems to make it work. Jrun is no
longer compatible with latest version of JRE 1.6 and cannot be installed to run it on the
fly.

Sun Micrsystems never realeased a offical filter for there latest version of JVM.dll to
handle servlets or jsp, applets or any technology to handle pre hyper text request on
open tag pages. They never came out with a appropiate ISAPI Filter directly from them.

Its pretty bad when you have to seek out other vendors like Jrun, Tomcat, or resin to
make there technology work. Why they dont make the mappings or ISAPI filters
themselves i have no clue. But its simply retarded

Java appears to be dying.

33 Steve
Jul. 10th, 2007 at 2:40 am

THanks for the info anyway btw Smitty. i have had Tomcat running before and Jrun
both, it just amazes me after installing other technologies. How sun microsystems cant
even make there stuff to work on windows IIS servers standing alone.

drop me a line with your comments on it webmaster@area51solutions.com

34 perthius007
Aug. 29th, 2007 at 9:26 pm

If you follow the steps outlined in the document, you will get your IIS / Tomcat
working......trust me.

Troy

P.S. Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank
you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank
you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank
you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

35 Hans
Nov. 18th, 2007 at 5:44 pm

I only got 404 from isapi_redirect.dll.

With winxp, everything was ok, but win2003server SP1 didn't work.

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 11 de 20

The problem was some security settings:

IIS -> Web Service Extensions -> All Unknown ISAPI Extenions

I changed from 'Prohibited' to 'Allowed'.

36 Mahmoud Al-Qudsi
Nov. 18th, 2007 at 7:32 pm

Hans,

That is a security risk; if you followed this part from the article above, you shouldn't
need to do that:

Next you need to tell IIS that these files are a-OK, and that it’s safe to run them.
In the IIS management center again, click “Web Service Extensions” -> “Add a
new Web service extension..” For ‘extension name’ enter “JSP” and for the
executable file, locate $CATALINA_HOME/bin/isapi_redirect.dll, check “set this
extension to allowed”, and then press OK.

37 zac
Nov. 20th, 2007 at 12:31 am

I am unable to get the isapi_redirect.dll to load in IIS. I get the red down arrow. I
suspect the problem may be permissions on the .dll. On Aug 9 2006 you said:

"Right-click the DLL and add iusr_COMPUTERNAME as a user with read


privellages."

This step I do not quite understand, can you please provide further information?

By the way, if I click 'Web Sites -> Services -> Run WWW service in IIS5 isolation
mode' then it DOES load that .dll however when I access the page (localhost/myapp/) I
get this error:

"HTTP Error 401.3 - Unauthorized: Access is denied due to an ACL set on the requested
resource."

38 zac
Nov. 20th, 2007 at 2:36 am

UPDATE: I right clicked the .dll and added 'Everyone' as a user and gave them read
privileges. Now everything works great, green arrows and I am running
locahost/myapp/.

However, is this a security hole? I guess ideally I should add the "iusr" instead of
everyone, however I don't know how to do that.

39 Mahmoud Al-Qudsi
Nov. 20th, 2007 at 6:46 am

There is an account on your PC called iuser_something.

This is the IIS generic user account. The "something" is the name of your PC. For
instance, if your PC is named server_jimmy_neutron_3 then that's what you plug-in
instead of "something." ;)

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 12 de 20

40 zac
Nov. 20th, 2007 at 7:24 am

I tried that (ie. IUSR_JKS47847894) but it just said 'an object named XYZ couldn't not
be found'.

However I then tried just searching for all users* and managed to find the 'Internet
Guest Account' - added that and it works fine. Have removed the Everyone option.

right click isapi_redirect.dll -> properties -> security tab -> Add -> Advanced ->
Object Types: Users -> 'Find Now' -> select a suitable user -> OK -> OK -> check
read permission is checked.

Thanks for this guide, I would still be tearing my hair out without it.

41 Mahmoud Al-Qudsi
Nov. 20th, 2007 at 7:50 am

That's why we wrote it :)

See, it's a little-known fact that the reason it's guys that go bald is because it's mostly
guys that mess around with frustrating stuff like this ;)

42 Joan
Nov. 25th, 2007 at 3:44 pm

Computer Guru... Are you running JSPs on IIS 6 or did you have to change IIS 6 to
"Run WWW service in IIS 5 isolation mode"? Everything I've read says to change it to
isolation mode, which I can't do because it defeats the purpose of using 6.

43 Mahmoud Al-Qudsi
Nov. 25th, 2007 at 4:07 pm

Joan, we'd never write a guide that advises/entails the use of IIS 5 Isolation Mode :)

All this is in plain 6. You can apply the steps (as we have done many times since posting
this guide) as-is on a fresh install of Windows Server 2003.

44 Mahmoud Al-Qudsi
Nov. 25th, 2007 at 4:14 pm

Update:

I just noticed something that might have been a tad misleading: you need to also double-
check the paths in the other .properties file as well.

I've updated the article with a recommendation to open all the downloaded configuration
files in WordPad/Notepad/Whatever and make sure they're pointing to the correct path
first.

45 smitty
Nov. 27th, 2007 at 12:15 am

Computer Guru:

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 13 de 20

Follow the same instructions you wrote for IIS 6 but do the following for IIS 7 support
in Vista or 2008 server. If it works in IIS 6 it will work in IIS 7 with some additional
steps.

To allow IIS jakarta connector in IIS7:

Install 'IIS Metabase and IIS6 configuration compatibility' feature under Server
Manager.

Install isapi_redirect. Go to IIS.

Click on Computer Name

Launch 'ISAPI and CGI Restrictions'

Add jakarta with path to your isapi_redirect.dll.

Restart IIS.
46 satpal
Nov. 30th, 2007 at 4:40 pm

ive got tomcat installed works fine, but doesnt work with IIS, but that may be because
the server im using is on XP not windows server 2003.

47 Mahmoud Al-Qudsi
Nov. 30th, 2007 at 4:46 pm

The instructions above are for IIS 6 (ships with Server 2003), not 5 (which ships with
Windows XP); but should be similar enough to follow.

Only change is you won't have to do the allowed extension stuff.

48 groove
Dec. 7th, 2007 at 8:45 pm

Ok ! I have configured this umptee number of times and have managed to get it work
every time. It's not always sure whether it'll work the first time or not, but after trying 2-
3 times it does work. However, with a new application we've run into a very peculiar
issue. It's like then we have IIS configured to service up our tomcat application over port
80. Tomcat itself listens for HTTP requests over port 8090 and for AJP requests over
port 8009. All well and good.

The problem we have run into is that the application sends some 'response.sendRedirect'
responses based on certian conditions. TomCat while sending the redirect URLs is
tagging on the 8090 port number to the 'host'. That cause the redirects to fail because IIS
is not listing on port 8090 (we have 2 servers - an IIS server that sits in the DMZ and a
seperate Tomcat server that sits on an internal network). The hostname is correct (it
point to the IIS Server's FQDN), it's the port (http://IIS-FQDN:8090) that's messed up !
How do we work around this issue ?

Any help will be appreciated.

Thanks

Gurvinder

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 14 de 20

49 Mahmoud Al-Qudsi
Dec. 8th, 2007 at 5:20 pm

I think (though I'm not sure if that's your case with the info you provided) that this is the
application at fault, rather than the configuration.

The application should have an option for the domain name + port. In our case, we have
it configured to the publically-accessible domain+port (neosmart.net:80) with the
application path - this is the path the application generates for redirects and for links in
emails, etc.

If your app doesn't have that option - you're kind of in a bad place.

You'll need to have Tomcat associated with port 8090 on localhost only, and associate
IIS on 8090 as well for external requests.

Should do the trick.

50 Shane
Feb. 20th, 2008 at 8:37 pm

Hello,

This works great for IIS, but I can't for the life of me get it to work on IIS 5. The only
step I see that doens't apply to IIS 5 is the that I don't have to add JSP as a Web Service
Extension. Any ideas?

51 Shane
Feb. 20th, 2008 at 8:38 pm

excuse me, I meant to say it works great for IIS 6

52 Shane
Feb. 20th, 2008 at 8:44 pm

actually, nevermind, IIS 5 is a bit slower than IIS 6 I guess

I just had to restart the IIS service, not simply start and stop IIS, and it worked

53 Mahmoud Al-Qudsi
Feb. 20th, 2008 at 10:17 pm

Thanks for letting us know it worked on IIS5, Shane.

54 Douglas
Feb. 27th, 2008 at 6:42 pm

Hiya! Really useful guide, has helped me lots. I'm setting up JSP 5.0 with IIS 5.1 (XP
Pro), and it's all working - i.e. http://localhost/jsp-examples - and they all execute
beautifully - but I want to be able to use JSP files generally throughout my
c:\Inetpub\wwwroot application... ASP, ASP.NET are working fine with IIS... and
Tomcat is working perfectly on Port 8080. However, when I put a simple hello world
script named first.jsp in the wwwroot folder, I either get the message "The specified CGI
application misbehaved by not returning a complete set of HTTP headers. The headers it
did return are:" with the .jsp extension pointing to "C:\Program Files\Apache Software
Foundation\Tomcat 5.0\bin\tomcat.exe" and when I point the application configuration
to "C:\Program Files\Apache Software Foundation\Tomcat 5.0\native\i386

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 15 de 20

\isapi_redirector2.dll" I get the error "The specified module could not be found". Last
night I managed to get the page to load without any error but when I checked the source
there was no output at all even with basic html. I'm gonna continue with this just now,
but I've been at it for 2 days now... hoping to have a break tonight... if I get it working
before tonight I'll celebrate. Anyway, would really appreciate any tips!! Thanks in
advance.

55 Douglas
Feb. 27th, 2008 at 6:57 pm

P.S. I should say that I've used setupjk204.exe which sets up isapi_redirector2.dll
automatically for IIS and Tomcat... know that's cheating, but the past few days I've spent
setting it up manually and got no where... if you're clever though you can look over the
configuration files and see how it's done for your particular system ;)

56 Rogerio G Miranda
Apr. 14th, 2008 at 1:31 pm

My configuration work fine.


But not working my pages .asp, look erro message:

HTTP Status 404 - /censo/index.asp

type Status report

message /censo/index.asp

description The requested resource (/censo/index.asp) is not available.

and the title tab is: Apache Tomcat/6.0.16 - Error report

my environment is: Win2003Server, IIS6, Tomcat 6.01.16, redirect.dll (ver 1.2.26)


Can you help-me?
Rogerio

57 Mahmoud Al-Qudsi
Apr. 14th, 2008 at 2:47 pm

Like it says in the article - support requests should go in the forums.

http://neosmart.net/forums/

58 Lori Holmes
Aug. 22nd, 2008 at 6:48 pm

Hello,

Please update the Java link above (under "Install JVM") to:

http://java.sun.com/javase/downloads/index.jsp

The old one is no longer accurate.

Thank you,

Lori Holmes

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 16 de 20

Program Manager

Download Operations

Sun Microsystems

59 Mahmoud Al-Qudsi
Aug. 22nd, 2008 at 7:03 pm

Link fixed, thanks for the tip.

60 Hi guys
Nov. 6th, 2008 at 4:17 am

Im having problem configuring it to IIS 5.1 my tomcat is 6.0.18 and tomcat-connectors-


1.2.27. I receiving an error of HTTP 404 - File not found. I dont found any errors on the
logs anyone guys can help me.

61 Mike Clarke
Nov. 18th, 2008 at 9:12 pm

Hey,

Do you have any documents that cover IIS + Jakarta + Tomcat Single-Sign-On?

Thanks,
Mike

62 Mahmoud Al-Qudsi
Nov. 18th, 2008 at 11:42 pm

Hi Mike,

We don't have any other IIS + JSP guides than this - what is it that you're trying to do
exactly? Which SSO provider are you using?

I might be able to give you a push in the right direction: NST currently has an SSO
system running on Tomcat invisibly over IIS and everything's running well.

63 Obviously
Dec. 19th, 2008 at 6:00 pm

Obviously, this does not work. In the beginning you state: [quote]This guide assumes
you already have II6 6.0 configured and running 100% with everything all right and
trouble-free, and assumes Tomcat (and it’s prerequisites) isn’t already installed. Here
goes..[/quote]

I have followed these instructions without fault, many times. Even though this is the best
tut I have found explaining this, it is not correct. I have gone through this 5 times and
still nothing. I have added the IUSR and IWAM users to the entire directory tree,
nothing. The only thing I am able to see is the http://localhost:8080 which leads me to
believe that Tomcat is working. I cannot see the samples or the examples. When I have
the isapi_redirect added in the isapi filters it will not allow my localhost (default web
site) will not load. I check the isapi filters and the isapi_redirect-XXX.dll will not load
with a red down arrow. Any help is appreciated on this. My e-mail address is
terry@graybell.net. Please feel free to contact me if you have had trouble with this and
were able to figure it out. Thanks, Terry.

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 17 de 20

64 Mahmoud Al-Qudsi
Dec. 19th, 2008 at 6:28 pm

Obviously, it does work... or else a hundred people before you wouldn't have posted
their thanks.

65 Obviously
Dec. 19th, 2008 at 6:33 pm

"It covers all the prerequisites and how to get them up and running."

No it doesn't. According to the tutorial it says that this will work on "IIS 6 on Windows
Server 2003 with SP1 installed". Prove me wrong please.

66 Thanh
Dec. 23rd, 2008 at 7:12 pm

Hi, can you help configure for IIS 7 with tomcat 6. Because i use Vista HomePremium,
IIS 7 was default installed. Help me please.

67 Toby
Feb. 6th, 2009 at 9:57 am

Just want to say thanks and I got it working here with Win2003 sp2, iis6.0 and tomcat6,
jdk1.6.0_12 (both latest at time of writing).

At the top you say requires JDK, so I installed the JDK but is it really nessesary? I
wonder if just the JRE would have done. Also I wasn't sure exactly which files to set the
IUSR_ read/execute permissions on so i allowed all the files you mentioned. I'm not
clear about these two points but its working so I'm happy.

68 Suman Rai
Feb. 22nd, 2009 at 7:16 am

Hi,
Well Done ! and Thank You! It's work.

69 Anne
Feb. 27th, 2009 at 8:17 pm

Thank you ! This was the first reference that start to finish enabled me to get Tomcat
working with IIS. The biggest piece I was missing was I didn't have sample
workers.properties files and uriworkermap.properties to work with.
Thanks for the clear instructions!

70 suv
May. 18th, 2009 at 5:43 am

i guess i'm kinda too l8 for this post... but still,, i have got isapi_redirect workking fine
on my machine. but i've got to connect it on my college website... is there a way that the
connector doesnt disturb the default website and still runs my JSP content???

71 Phil
May. 25th, 2009 at 6:07 am

Hey suv,

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 18 de 20

The way that i have corrected all the issues is to modify the above instructions a little. If
you only have a single site the ones above will work fine. However we have 9 sites in
our IIS configuration. Where the above instructions refer to Default Website you
substitute your website. You will need to configure the jakarta virtual directory under
that site as well as the virtual directory specific to the application.

For example we have

Employee SS (website)
>jakarta (bin folder)
>webapp01 (webapp folder)

Be sure to install the isapi_redirector on that web site as well and not on the default one.

Testing ours on the server fails but works fine live.

Could be wrong but is what works for us.

Kind Regards,

Phil

72 Paul
Jul. 12th, 2009 at 2:26 pm

Thanks for the great article!

Just a couple of notes that helped me out. I'm running Windows server 2003 sp1.

I had to rename isapi_redirect-xxxxx.dll to isapi_redirect.dll; that wasn't super obvious


in the installation notes.

Restarting IIS was not enuff for me, had to do a system reboot and then everything
worked correctly.

thanks again!

73 Rich
Sep. 11th, 2009 at 3:18 am

Right-click the default website again, and this time add a “Virtual Directory” called
‘jakarta’ (without the quotes!) that points to $CATALINA_HOME/bin/ (the same place
as isapi_redirect.dll). Give it ‘execute’ privileges when prompted. You need to set
permissions on the the files we’ve just modified/created in order for the filter to work.

IIS 7 Windows Server 2008 - Does anyone have an update?

74 Rizwan Minhas
Dec. 13th, 2009 at 5:07 am

Hi guys, I was also having issues with this configuration. I was also getting 500 and 404
pages. but finally I got it to work by using following configurations:

I have windows 7, IIS 7, Tomcat 6.x, JDK and JRE 6.

make sure that you permissions for the DLL file.


make sure that your virtual directory is pointing to the same directory where you have

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 19 de 20

your isapi_redirect.dll.
make sure that your tomcat is running.
make sure that you have allowed isapi_redirect.dll in the "isapi and CGI restrictions"
make sure that *.jsp is enabled in "handler mappings"
make sure that "isapi_redirect.dll" is "enabled" in "ISAPI filters" under "default web
site"
make sure that there are no typos and all the paths are correct in you *.properties files.

There is also another very good guide with screen shots at http://www.iisadmin.co.uk/?
p=72

if you still cant get it to work then tell me your exact problem, I will be happy to help
you, happy coding !

75 Rizwan Minhas
Feb. 24th, 2010 at 2:55 am

Rizwan,

I was able to get everything running, with the Tomcat logs showing clean worker logs
and such, the example site seems to work fine, but for the life of me, I can't get it to load
any index.jsp pages. Have you got this working?

Thanks,
Ryan

76 mak
May. 5th, 2010 at 3:45 pm

hi ,

Good explaination ,

Mak

www.Centrify.com/Express Ads by Google

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011
Configuring JSP for IIS — The NeoSmart Files Página 20 de 20

http://neosmart.net/blog/2006/configuring-jsp-for-iis/ 14/01/2011

You might also like