Unable to link IIS8 and Tomcat7 by ISAPI on Windows Server 2012
I never had much success configuring it unless the virtual directory used the name jakarta and nothing else. The conf and logs directories needed to be subdirectories of the ISAPI installation directory.
If you created those .properties files using a right-click and New Text Document, that Windows didn't add a .txt extension to them.
Finally, use 127.0.0.1 instead of localhost in your workers.properties. I don't know why but it doesn't work using localhost on Windows 2012.
Related videos on Youtube
Abhinav
Updated on September 18, 2022Comments
-
Abhinav over 1 year
Firstly, I am completely new to IIS and Windows Server. Previously I used to work only on Apache and Linux.
I want to link IIS8 and Tomcat 7.0.34 under a subdomain, such that when someone visits
subdom.mydomain.com
then only, IIS forwards requests to tomcatI consulted these two references:
http://lab.usgin.org/applications/doc/make-tomcat-6x-work-iis7 http://tomcat.apache.org/connectors-doc/reference/iis.html
and did exactly how they have shown. Below are the steps I have done:
Downloaded windows x64 ISAPI binary from http://apache.techartifact.com/mirror//tomcat/tomcat-connectors/jk/binaries/windows/ and placed that
isapi_redirect.dll
in a directory nameisapi
created under my tomcat installation directory.I created a workers.properties file and placed it in tomcat's
conf
directory
worker.list= tomcatworker1 worker.tomcatworker1.host=localhost worker.tomcatworker1.port=8009 worker.tomcatworker1.type=ajp13
- Then I created a
uriworkermap.properties
file and placed it in tomcat'sconf
directory with following content(as I want tomcat's root app to run at the root path of subdomain):
/*=tomcatworker1
Then I created a
isapi_redirect.properties
file and placed it inisapi
directory under my tomcat installation with following content:# Configuration file for the Jakarta ISAPI Redirector # The path to the ISAPI Redirector Extension, relative to the website # This must be in a virtual directory with execute privileges extension_uri=\tomcat\isapi_redirect.dll # Full path to the log file for the ISAPI Redirector log_file=C:\Program Files\Apache Software Foundation\Tomcat 7.0_Tomcat7_ins1\logs\isapi_redirect.log # Log level (debug, info, warn, error or trace) log_level=info # Full path to the workers.properties file worker_file=C:\Program Files\Apache Software Foundation\Tomcat 7.0_Tomcat7_ins1\conf\workers.properties # Full path to the uriworkermap.properties file worker_mount_file=C:\Program Files\Apache Software Foundation\Tomcat 7.0_Tomcat7_ins1\conf\uriworkermap.properties
In IIS Manager, in main server node and selected ISAPI and CGI Restrictions feature. Opened it and add a new restriction with the following information:
ISAPI or CGI path = {My Tomcat Directory Path}\isapi\isapi_redirect.dll Description = Tomcat Select "Allow extension path to execute"
Created a new site with binding
subdom.mydomain.com
and in it added a new virtual directory with the following properties:Alias = tomcat Physical path = {my Tomcat root directory}\isapi
Next, ISAPI Filters feature under my new web site's node. Create a new filter with this information:
Filter name = tomcat Executable = {my Tomcat root directory}\isapi\isapi_redirect.dll
At last, made sure that the ISAPI handler is enabled.
After doing all these things, when I accessed my subdomain, I came up with a run time error, which I don't know how to resolve. check out error at this link http://backops.cmee.in/
-
Admin about 11 yearsI have not had much luck with ISAPI connector for IIS 8. I removed it and used the BonCode connector instead. It was simple.
-
Abhinav about 11 yearsI get it working now. It was not that much tough, I you like I could share the process.
-
ErikE over 8 yearsEven though you got it working my suggestion would be to install the Application and Request Routing module on IIS together with a common http connector instead of AJP in Tomcat. That is, since IIS is fronting go the IIS native way (which is also supported by Tomcat) rather than use the Tomcat way intended for an Apache frontend (which is not supported by Microsoft). Or switch to Apache and use AJP instead of IIS with ARR and http.
-
Abhinav about 11 yearsI get it working now. It was not that much tough, I you like I could share the process.
-
Olaf over 8 yearsThe answer is old, but maybe you (or someone) still is puzzled on why
localhost
sometimes is working and sometimes it isn't: These days it's often aliased to::1
, which is the IPV6 version of localhost. If a server only answers on IPV4, naturally you can't reach it. Happy 20th birthday to IPV6.