Putting servoy behind IIS (tomcat connector)

I am running servoy (5.x) on a win2k3 server that is running IIS. The IIS is delivering a couple of critical applications on port 80 & 443, so servoy is running on 8080 and 8443 (for SSL). Everything is running just fine but the non-standard ports makes it hard to conect to the servoy app sometimes (ie through coprorate firewalls). Server only has a single IP so I cant run the apps on separate IPs. I’d like to put servoy behind IIS on port 80 using the tomecat jk 1.2 connector so that instead of:
http://server.com:8080/servoy-webclient
the user can type
http://server.com/servoy-webclient
and get to servoy. Much neater :)
So I followed the instructions for installing an ISAPI filter for IIS 6.0 here: http://www.iisadmin.co.uk/?p=40
The install works perfectly and everything looks good except it doesnt work ;)
When trying to access the servoy app through port 80 I can see in the logs that the ISAPI filter is trying to forward the request onto tomcat:

Sat Dec 12 20:04:12.740 2009] [1468:5956] [debug] jk_uri_worker_map.c (863): Found a wildchar match ‘/servoy-webclient*=worker1’
[Sat Dec 12 20:04:12.740 2009] [1468:5956] [debug] jk_isapi_plugin.c (1922): check if [/servoy-webclient/] points to the web-inf directory
[Sat Dec 12 20:04:12.740 2009] [1468:5956] [debug] jk_isapi_plugin.c (1938): [/servoy-webclient/] is a servlet url - should redirect to worker1
[Sat Dec 12 20:04:12.740 2009] [1468:5956] [debug] jk_isapi_plugin.c (1978): fowarding escaped URI [/servoy-webclient/]

…but…its doesnt like the reply it gets from tomcat (servoy):

[Sat Dec 12 20:04:12.740 2009] [1468:5956] [debug] jk_ajp_common.c (931): Connected socket 632 to (127.0.0.1:8080)
[Sat Dec 12 20:04:12.740 2009] [1468:5956] [debug] jk_ajp_common.c (1070): sending to ajp13 pos=4 len=470 max=8192

[Sat Dec 12 20:04:12.740 2009] [1468:5956] [debug] jk_ajp_common.c (1560): (worker1) request body to send 0 - request body to resend 0
[Sat Dec 12 20:04:12.771 2009] [1468:5956] [error] jk_ajp_common.c (1172): wrong message format 0x4854 from 127.0.0.1:8080

…after which it fails and the end-user sees a message ‘Bad Gateway’ indicating that the ‘upstream’ server (tomcat/servoy) sent back the wrong answer.

I have spent many hours on this and have exhausted my knowledge of tomcat (not much to start with). Has it got anything to do with the connector type? It seems that the ISAPI filter is trying to make a connection of type ajp13 (standard tomcat connector). But the definations in the server.xml file for servoy are:

protocol=“HTTP/1.1”
would this make any dirrerence? Should I have a protocol=“AJP/1.3” in there somehow?

Any thoughts?
Happy to provide more log files, config files if required but I was tyying to keep the initial post readable :)

More information. When I look in the .service_log.txt file I can see my three connectors start-up ok:

STATUS | wrapper | 2009/12/12 20:22:59 | → Wrapper Started as Service
STATUS | wrapper | 2009/12/12 20:23:00 | Launching a JVM…
INFO | jvm 1 | 2009/12/12 20:23:01 | Wrapper (Version 3.1.2) http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2009/12/12 20:23:01 |
INFO | jvm 1 | 2009/12/12 20:23:09 | Dec 12, 2009 8:23:09 PM org.apache.coyote.http11.Http11Protocol init
INFO | jvm 1 | 2009/12/12 20:23:09 | INFO: Initializing Coyote HTTP/1.1 on http-8080
INFO | jvm 1 | 2009/12/12 20:23:09 | Dec 12, 2009 8:23:09 PM org.apache.coyote.http11.Http11Protocol init
INFO | jvm 1 | 2009/12/12 20:23:09 | INFO: Initializing Coyote HTTP/1.1 on http-8443
INFO | jvm 1 | 2009/12/12 20:23:09 | Dec 12, 2009 8:23:09 PM org.apache.catalina.startup.Catalina load
INFO | jvm 1 | 2009/12/12 20:23:09 | INFO: Initialization processed in 1140 ms
INFO | jvm 1 | 2009/12/12 20:23:09 | Dec 12, 2009 8:23:09 PM org.apache.catalina.core.StandardService start
INFO | jvm 1 | 2009/12/12 20:23:09 | INFO: Starting service Catalina
INFO | jvm 1 | 2009/12/12 20:23:09 | Dec 12, 2009 8:23:09 PM org.apache.catalina.core.StandardEngine start
INFO | jvm 1 | 2009/12/12 20:23:09 | INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
INFO | jvm 1 | 2009/12/12 20:23:11 | Dec 12, 2009 8:23:11 PM org.apache.jk.common.ChannelSocket init
INFO | jvm 1 | 2009/12/12 20:23:11 | INFO: JK: ajp13 listening on /0.0.0.0:8009
INFO | jvm 1 | 2009/12/12 20:23:11 | Dec 12, 2009 8:23:11 PM org.apache.jk.server.JkMain start

(I decided to start an ajp13 connector on 8009). Then later down the log file I see:

INFO | jvm 1 | 2009/12/12 20:25:01 | Dec 12, 2009 8:25:01 PM org.apache.jk.common.MsgAjp processHeader
INFO | jvm 1 | 2009/12/12 20:25:01 | SEVERE: BAD packet signature 5635
INFO | jvm 1 | 2009/12/12 20:25:08 | Dec 12, 2009 8:25:08 PM org.apache.jk.common.ChannelSocket receive
INFO | jvm 1 | 2009/12/12 20:25:08 | WARNING: can’t read body, waited #256
INFO | jvm 1 | 2009/12/12 20:25:08 | Dec 12, 2009 8:25:08 PM org.apache.jk.common.ChannelSocket processConnection
INFO | jvm 1 | 2009/12/12 20:25:08 | WARNING: Closing ajp connection -1
INFO | jvm 1 | 2009/12/12 20:25:08 | Dec 12, 2009 8:25:08 PM org.apache.jk.common.MsgAjp processHeader
INFO | jvm 1 | 2009/12/12 20:25:08 | SEVERE: BAD packet signature 18245
INFO | jvm 1 | 2009/12/12 20:25:08 | Dec 12, 2009 8:25:08 PM org.apache.jk.common.ChannelSocket processConnection
INFO | jvm 1 | 2009/12/12 20:25:08 | SEVERE: Error, processing connection

other posts in other forums indicate this error occurs when the ajp13 connector receives a non-ajp packet…hmm

As far as I can see the jk connector in the ISAPI filter isapi_redirect.dll has to talk ajp13?

now i am really confused

Fixed it!
Here’s the explanation in case anyone else is stupid enough to try and do this :)
You must have an ajp13 connector defined on another port in the server.xml file - then configure that ISAPI filter to forward requests to that connector. So after you have followed the instructions in the http://www.iisadmin.co.uk/?p=40 link you also need to modify your various setup files so that they look something like this:

worker.properties:

Define 1 real worker using ajp13

worker.list=worker1

Set properties for worker1 (ajp13)

ajp13 sits on another port to receive messages from ISAPI filter

worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

uriworkermap.properties:

Sites to be redirected to Tomcat

redirect servoy URI to tomcat worker

/servoy*=worker1
/images*=worker1
/lib*=worker1

\Program Files\Servoy\application_server\server\conf\server.xml

-

NOTE: I have 3 connectors defined (8009, 8080 and 8443). 8009 and 8080 redirect to 8443 which is the SSL port so all connectivity is via SSL.

After restarting IIS I can now connect to:

https://server.net/iis-application
AND
https://server.net/servoy-webclient

ie to the outside world they both appear to be on the standard (443) SSL port - which is great as it means I can get to them from anywhere through corporate firewalls.

Hope this helps others.
Al