Apache Tomcat and IIS 6 with JK2

Dear Community,

please help me to solve this though problem by installing and cofigure Apache Tomcat with IIS 6. Firstly Ive tried to use Apache Connector 1.2 but after day try it still didnt work. So I took another tutorial http://tjworld.net/help/kb/0001_iis6-Tomcat5-JK2.html and made every step as described. And O what a bliss the jsp-examples were successful!!! After that I changed IP Adress in workers2.properties to DNS Name, restarted and - it doesnt work anymore. Everything Ive done - changed name. Ping this DNS Name goes clean. Whats wrong?

Notes:
jk2.properties exists, Tomcat default
isapi_redirector2.dll is tied to IIS, virtual directory, registry, isolation mode to IIS 5, ISAPI Filter, extensions - everything is done.
as you can see below - there is two uri's to work with - IP (local network) IT WORKS!!! and 'intranet' DNS for the same computer (with IP ) wich doesnt work..... It's annoying!

much obliged for every kind of help.

boris

My properties:

workers2.properties:
[logger]
# log levels specified here are ERROR, INFO, DEBUG
level=ERROR

[shm:]
info=Shared memory file. Required for multiprocess servers
file=C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\jk2.shm
size=1000000

[channel.socket:]
info=Ajp13 worker, connects to tomcat instance using AJP 1.3 protocol
tomcatId=localhost:8009

[uri:]
info=JSP examples, map requests for all JSP pages to Tomcat.
context=/jsp-examples

[uri:]
info=Servlet examples, map requests for all servlets to Tomcat.
context=/servlets-examples

[uri:]
info=JSFaces
context=/

[uri:]
info=JSPages
context=/

[uri:]
info=Servlets
context=/servlets/

# working
[uri:]
info=MyJSPApplication over IP
context=/wt

# doesn't
[uri:intranet/wt/*]
info=MyJSPApplication over Name
context=/wt

# doesn't
[uri:intranet/*.jsp]
info=JSPages
context=/

# doesn't
[uri:intranet/servlets/*]
info=Servlets
context=/servlets/

# doesn't
[uri:intranet/*.faces]
info=JSFaces
context=/

[status:]
info=Status worker, displays runtime information

[uri:/jkstatus/*]
# View the status of the ISAPI connector via
info=The Tomcat /jkstatus
handlergroup=status:

server.xml
a part of:
<Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" />

<Connector port="8009" enableLookups="false" redirectPort="8443" debug="0" protocol="AJP/1.3" />

Dani AI

Generated

got JSPs working when the connector used the numeric address but the same mappings stopped after switching the workers/URI entries to the DNS name. correctly flagged name resolution as a common culprit, but on an IIS6 + Tomcat Windows box there are a few additional, specific checks that commonly explain this exact behavior.

Recommended checks to run on the IIS/Tomcat host (do them locally on the server):

  • Confirm the name resolves from the server process context (nslookup/ping the name on the server and from an elevated prompt). On Windows the local override is the hosts file at C:\Windows\System32\drivers\etc\hosts.
  • Verify AJP reachability to Tomcat using the hostname and the numeric IP. Example commands:
    telnet intranet 8009
    netstat -an | find "8009"

    Also Test-NetConnection (PowerShell) can test a TCP port if available. The goal is to prove the redirector can open a socket to Tomcat by name.

Key configuration points and why they matter:

  • JK/JK2 matches the Host header. A mismatch between the exact host string sent by the browser (short name vs FQDN vs port) and the host part used in the [uri:...] mapping will prevent routing. Use a host-independent mapping (wildcard) while debugging, or add the exact host string the client sends.
  • Check IIS site bindings/host headers: if the Web Site is bound only to a different host header or IP, requests may land on a different site where the ISAPI redirector is not active.
  • Enable debug logging for the ISAPI redirector and inspect both the redirector log and Tomcat logs: look for “no worker matched” or connection refused messages to tell whether the failure is routing or connectivity.

Most likely causes here are (a) Host-header/URI mismatch or (b) AJP not reachable via the name even though the name resolves. Use the reachability tests and debug logs to pinpoint which, then either adjust the workers/uri mapping to match the exact Host header or bind Tomcat/AJP to the interface/name the redirector targets.

this sounds like a dns issue.

the ip needs to be defined in /etc/hosts for the local machine as well
ensure that /etc/hosts is setup correctly and there are seperate entries
for localhost and your system like so:

127.0.0.1 localhost localhost.localdomain
192.168.0.x proxyserver proxyserver.yourdomain.com
192.168.0.z proxyserver proxyserver.yourdomain.com

double check /etc/resolv.conf and ensure it is pointing at the dns server

double check /etc/nsswitch.conf and see if the order on the hosts line
is " hosts: files dns"

ensure dns resolves correct by using the dig or nslookup commands.

restart the domain and apache.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.