Serving TeamCity pages through IIS via Tomcat connector

Hi

I'm trying to get TeamCity running on a server that already has a bunch of sites running under IIS on port 80. I want to be able to access teamcity via a nice host header domain name like "teamcity.mycompany.server". On the server itself, I've installed TeamCity and tested it running at localhost:8083, and it's working fine. Having followed the instructions at:

http://tomcat.apache.org/connectors-doc/webserver_howto/iis.html

I can see an isapi.log file being written to in c:\teamcity\logs, but in the browser at http://teamcity.mycompany.server I see only:

Directory Listing Denied


This Virtual Directory does not allow contents to be listed.

I get the feeling I'm very close, but I just need a hand getting the final piece of the jigsaw in! I think I might need to do something in my (currently empty) workers.properties and uriworkers.properties files? Or possible some sort of catalina config?

Any pointers gratefully received....

Lee

PS

The contents of my isapi.log file are below:

[Wed Mar 03 18:55:48.031 2010] [4736:3092] [debug] jk_util.c (459): Pre-processed log time stamp format is '[%a %b %d %H:%M:%S.000 %Y] '
[Wed Mar 03 18:55:48.078 2010] [4736:3092] [info] jk_isapi_plugin.c (2403): Starting Jakarta/ISAPI/isapi_redirector/1.2.30
[Wed Mar 03 18:55:48.093 2010] [4736:3092] [debug] jk_isapi_plugin.c (2421): Detected IIS version 6.0
[Wed Mar 03 18:55:48.125 2010] [4736:3092] [debug] jk_isapi_plugin.c (2426): Using registry.
[Wed Mar 03 18:55:48.140 2010] [4736:3092] [debug] jk_isapi_plugin.c (2429): Using log file c:\teamcity\logs\isapi.log.
[Wed Mar 03 18:55:48.156 2010] [4736:3092] [debug] jk_isapi_plugin.c (2430): Using log level 1.
[Wed Mar 03 18:55:48.203 2010] [4736:3092] [debug] jk_isapi_plugin.c (2431): Using extension uri /jakarta/isapi_redirect-1.2.30.dll.
[Wed Mar 03 18:55:48.218 2010] [4736:3092] [debug] jk_isapi_plugin.c (2432): Using worker file c:\teamcity\conf\workers.properties.
[Wed Mar 03 18:55:48.250 2010] [4736:3092] [debug] jk_isapi_plugin.c (2433): Using worker mount file c:\teamcity\conf\uriworkermap.properties.
[Wed Mar 03 18:55:48.296 2010] [4736:3092] [debug] jk_isapi_plugin.c (2435): Using rewrite rule file .
[Wed Mar 03 18:55:48.343 2010] [4736:3092] [debug] jk_isapi_plugin.c (2437): Using uri select 3.
[Wed Mar 03 18:55:48.375 2010] [4736:3092] [debug] jk_isapi_plugin.c (2438): Using no chunked encoding.
[Wed Mar 03 18:55:48.406 2010] [4736:3092] [debug] jk_isapi_plugin.c (2440): Using notification event SF_NOTIFY_AUTH_COMPLETE (0x04000000)
[Wed Mar 03 18:55:48.453 2010] [4736:3092] [debug] jk_isapi_plugin.c (2450): Using uri header TOMCATURI6A6B0000:.
[Wed Mar 03 18:55:48.484 2010] [4736:3092] [debug] jk_isapi_plugin.c (2451): Using query header TOMCATQUERY6A6B0000:.
[Wed Mar 03 18:55:48.531 2010] [4736:3092] [debug] jk_isapi_plugin.c (2452): Using worker header TOMCATWORKER6A6B0000:.
[Wed Mar 03 18:55:48.578 2010] [4736:3092] [debug] jk_isapi_plugin.c (2453): Using worker index TOMCATWORKERIDX6A6B0000:.
[Wed Mar 03 18:55:48.609 2010] [4736:3092] [debug] jk_isapi_plugin.c (2454): Using translate header TOMCATTRANSLATE6A6B0000:.
[Wed Mar 03 18:55:48.671 2010] [4736:3092] [debug] jk_isapi_plugin.c (2455): Using a default of 250 connections per pool.
[Wed Mar 03 18:57:53.187 2010] [920:1836] [debug] jk_util.c (459): Pre-processed log time stamp format is '[%a %b %d %H:%M:%S.000 %Y] '
[Wed Mar 03 18:57:53.265 2010] [920:1836] [info] jk_isapi_plugin.c (2403): Starting Jakarta/ISAPI/isapi_redirector/1.2.30
[Wed Mar 03 18:57:53.312 2010] [920:1836] [debug] jk_isapi_plugin.c (2421): Detected IIS version 6.0
[Wed Mar 03 18:57:53.343 2010] [920:1836] [debug] jk_isapi_plugin.c (2426): Using registry.
[Wed Mar 03 18:57:53.390 2010] [920:1836] [debug] jk_isapi_plugin.c (2429): Using log file c:\teamcity\logs\isapi.log.
[Wed Mar 03 18:57:53.453 2010] [920:1836] [debug] jk_isapi_plugin.c (2430): Using log level 1.
[Wed Mar 03 18:57:53.500 2010] [920:1836] [debug] jk_isapi_plugin.c (2431): Using extension uri /jakarta/isapi_redirect-1.2.30.dll.
[Wed Mar 03 18:57:53.546 2010] [920:1836] [debug] jk_isapi_plugin.c (2432): Using worker file c:\teamcity\conf\workers.properties.
[Wed Mar 03 18:57:53.593 2010] [920:1836] [debug] jk_isapi_plugin.c (2433): Using worker mount file c:\teamcity\conf\uriworkermap.properties.
[Wed Mar 03 18:57:53.640 2010] [920:1836] [debug] jk_isapi_plugin.c (2435): Using rewrite rule file .
[Wed Mar 03 18:57:53.718 2010] [920:1836] [debug] jk_isapi_plugin.c (2437): Using uri select 3.
[Wed Mar 03 18:57:53.781 2010] [920:1836] [debug] jk_isapi_plugin.c (2438): Using no chunked encoding.
[Wed Mar 03 18:57:53.921 2010] [920:1836] [debug] jk_isapi_plugin.c (2440): Using notification event SF_NOTIFY_AUTH_COMPLETE (0x04000000)
[Wed Mar 03 18:57:53.968 2010] [920:1836] [debug] jk_isapi_plugin.c (2450): Using uri header TOMCATURI6A6B0000:.
[Wed Mar 03 18:57:54.046 2010] [920:1836] [debug] jk_isapi_plugin.c (2451): Using query header TOMCATQUERY6A6B0000:.
[Wed Mar 03 18:57:54.093 2010] [920:1836] [debug] jk_isapi_plugin.c (2452): Using worker header TOMCATWORKER6A6B0000:.
[Wed Mar 03 18:57:54.156 2010] [920:1836] [debug] jk_isapi_plugin.c (2453): Using worker index TOMCATWORKERIDX6A6B0000:.
[Wed Mar 03 18:57:54.187 2010] [920:1836] [debug] jk_isapi_plugin.c (2454): Using translate header TOMCATTRANSLATE6A6B0000:.
[Wed Mar 03 18:57:54.218 2010] [920:1836] [debug] jk_isapi_plugin.c (2455): Using a default of 250 connections per pool.
[Wed Mar 03 18:57:54.265 2010] [920:1836] [debug] jk_uri_worker_map.c (1102): Loading urimaps from c:\teamcity\conf\uriworkermap.properties with reload check interval 60 seconds
[Wed Mar 03 18:57:54.296 2010] [920:1836] [debug] jk_uri_worker_map.c (171): uri map dump after file load: index=0 file='c:\teamcity\conf\uriworkermap.properties' reject_unsafe=0 reload=60 modified=1267642627 checked=1267642674
[Wed Mar 03 18:57:54.328 2010] [920:1836] [debug] jk_uri_worker_map.c (176): generation 0: size=0 nosize=0 capacity=0
[Wed Mar 03 18:57:54.375 2010] [920:1836] [debug] jk_uri_worker_map.c (176): generation 1: size=0 nosize=0 capacity=0
[Wed Mar 03 18:57:54.406 2010] [920:1836] [debug] jk_map.c (774): Checking for references with prefix worker. with wildcard (recursion 1)
[Wed Mar 03 18:57:54.453 2010] [920:1836] [debug] jk_shm.c (132): shared memory will contain 1 ajp workers of size 320 and 0 lb workers of size 320 with 0 members of size 384+320
[Wed Mar 03 18:57:54.484 2010] [920:1836] [debug] jk_shm.c (254): Initialized shared memory JKISAPISHMEM_TEAMCITY_MUSICGLUE_CHUCK_1544618374 size=448 free=320 addr=0x1e60000
[Wed Mar 03 18:57:54.515 2010] [920:1836] [debug] jk_worker.c (242): creating worker ajp13
[Wed Mar 03 18:57:54.562 2010] [920:1836] [debug] jk_worker.c (146): about to create instance ajp13 of ajp13
[Wed Mar 03 18:57:54.625 2010] [920:1836] [debug] jk_worker.c (159): about to validate and init ajp13
[Wed Mar 03 18:57:54.687 2010] [920:1836] [debug] jk_ajp_common.c (2605): worker ajp13 contact is 'localhost:8009'
[Wed Mar 03 18:57:54.734 2010] [920:1836] [debug] jk_ajp_common.c (2800): setting endpoint options:
[Wed Mar 03 18:57:54.812 2010] [920:1836] [debug] jk_ajp_common.c (2803): keepalive:              0
[Wed Mar 03 18:57:54.921 2010] [920:1836] [debug] jk_ajp_common.c (2807): socket timeout:         0
[Wed Mar 03 18:57:54.968 2010] [920:1836] [debug] jk_ajp_common.c (2811): socket connect timeout: 0
[Wed Mar 03 18:57:55.015 2010] [920:1836] [debug] jk_ajp_common.c (2815): buffer size:            0
[Wed Mar 03 18:57:55.062 2010] [920:1836] [debug] jk_ajp_common.c (2819): pool timeout:           0
[Wed Mar 03 18:57:55.093 2010] [920:1836] [debug] jk_ajp_common.c (2823): ping timeout:           10000
[Wed Mar 03 18:57:55.156 2010] [920:1836] [debug] jk_ajp_common.c (2827): connect timeout:        0
[Wed Mar 03 18:57:55.203 2010] [920:1836] [debug] jk_ajp_common.c (2831): reply timeout:          0
[Wed Mar 03 18:57:55.234 2010] [920:1836] [debug] jk_ajp_common.c (2835): prepost timeout:        0
[Wed Mar 03 18:57:55.281 2010] [920:1836] [debug] jk_ajp_common.c (2839): recovery options:       0
[Wed Mar 03 18:57:55.328 2010] [920:1836] [debug] jk_ajp_common.c (2843): retries:                2
[Wed Mar 03 18:57:55.375 2010] [920:1836] [debug] jk_ajp_common.c (2847): max packet size:        8192
[Wed Mar 03 18:57:55.453 2010] [920:1836] [debug] jk_ajp_common.c (2851): retry interval:         100
[Wed Mar 03 18:57:55.531 2010] [920:1836] [debug] jk_ajp_common.c (2662): setting connection pool size to 250 with min 125 and acquire timeout 200
[Wed Mar 03 18:57:55.578 2010] [920:1836] [debug] jk_uri_worker_map.c (171): uri map dump after extension stripping: index=0 file='c:\teamcity\conf\uriworkermap.properties' reject_unsafe=0 reload=60 modified=1267642627 checked=1267642674
[Wed Mar 03 18:57:55.609 2010] [920:1836] [debug] jk_uri_worker_map.c (176): generation 0: size=0 nosize=0 capacity=0
[Wed Mar 03 18:57:55.656 2010] [920:1836] [debug] jk_uri_worker_map.c (176): generation 1: size=0 nosize=0 capacity=0
[Wed Mar 03 18:57:55.703 2010] [920:1836] [debug] jk_uri_worker_map.c (482): Switching uri worker map from index 0 to index 1
[Wed Mar 03 18:57:55.750 2010] [920:1836] [info] jk_isapi_plugin.c (2573): Jakarta/ISAPI/isapi_redirector/1.2.30 initialized
[Wed Mar 03 18:57:55.828 2010] [920:1836] [debug] jk_isapi_plugin.c (1835): Filter started
[Wed Mar 03 18:57:55.875 2010] [920:1836] [info] jk_uri_worker_map.c (970): No worker maps defined for c:\teamcity\conf\uriworkermap.properties.
[Wed Mar 03 18:57:55.921 2010] [920:1836] [debug] jk_isapi_plugin.c (2055): [/] is not a servlet url
[Wed Mar 03 18:57:55.984 2010] [920:4740] [debug] jk_isapi_plugin.c (1835): Filter started
[Wed Mar 03 18:57:56.015 2010] [920:4740] [info] jk_uri_worker_map.c (970): No worker maps defined for c:\teamcity\conf\uriworkermap.properties.
[Wed Mar 03 18:57:56.062 2010] [920:4740] [debug] jk_isapi_plugin.c (2055): [/favicon.ico] is not a servlet url

10 comments

I've managed to get a bit closer. If I set my workers.properties file to:

workers.tomcat_home=c:\teamcity
workers.java_home=C:\teamcity\jre
ps=\
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13



And uriworkermap.properties to:

/*.jsp=ajp13

I can access teamcity.company.server/index.jsp and see the Tomcat home page, but following any links away from that page gives 404s. If I put a test.html file in the website root, I can request it ok but attempting to access any jsp files gives 404s. I think the connector is working between IIS and Tomcat, but now my gut tells me there is some misconfiguration in Tomcat/Catalina.
0

Lee,

Sorry for the delay in replying.

Is this still actual?

We do not have much experience with ISS, but the task should be doable (e.g. some users managed to do this). AFAIK you need to choose either using AJP or not, I'd try without AJP first.

As to whether Tomcat is configured properly, you can probably try to use Tomcat original address to see if TeamCity works OK.

If you still need help, please describe your Tomcat and ISS settings in detail so that we can try to figure out what is wrong this the setup.

0

Hi Yegor

Yes, this is still an issue for me. I've just stopped looking into it for now, but if you can help me I will give you all the info you need!

I'm not using IIS 7 so that is different to the person in the link you posted, we've got IIS 6 on Windows Server 2003.

My server config:

- "teamcity.company.servername" has been added to my hosts file and set that as the host header of my site in IIS 6
- "C:\TeamCity\bin\isapi_redirect-1.2.30.dll" has been added as the ISAPI filter on my IIS 6 site
- the home directory for the IIS 6 site is "C:\TeamCity\webapps\ROOT"

My teamcity settings:

Server Url: http://servername:8083          (I have tried setting this to teamcity.companyname.servername, but without any change in behaviour)

I have a registry key set on the server:

[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\1.0]

extension_uri = /jakarta/isapi_redirect-1.2.30.dll
log_file = c:\teamcity\logs\isapi.log
log_level = debug
worker_file = c:\teamcity\conf\workers.properties
worker_mount_file = c:\teamcity\conf\uriworkermap.properties



My workers.properties file looks like this:

workers.tomcat_home=c:\teamcity
workers.java_home=C:\teamcity\jre
ps=\
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13



My uriworkermap.properties looks like this:

/*.jsp=ajp13

I can reach the tomcat "home page" on http://teamcity.companyname.servername, but all the links away from that page fail with 404s.

Is there any other config info you require?

Cheers
Lee
0

Lee,

Let me note that you should be running Tomcat with TeamCity for it to work. Please ensure TeamCity works OK and all the pages are loading, etc.
Only after that you can setup IIS to forward requests to Tomcat server.

> - the home directory for the IIS 6 site is "C:\TeamCity\webapps\ROOT"
This seems wrong - as TeamCity should be working in Tomcat, IIS should not deal with the TemCity resources on disk in any way.

0

Hi Yegor

As you might have guessed, I'm an absolute novice when it comes to Tomcat!

yaegor wrote:

Let me note that you should be running Tomcat with TeamCity for it to work. Please ensure TeamCity works OK and all the pages are loading, etc.


As I understand it, the TeamCity installer installed TomCat on my server. This appears to be borne out by the fact that I have a service running called "TeamCity Web Server" which runs "c:\TeamCity\bin\tomcat6.exe //RS//TeamCity". TeamCity works fine when I reach it at http://myserver:8083.

yaegor wrote:

> - the home directory for the IIS 6 site is "C:\TeamCity\webapps\ROOT"
This seems wrong - as TeamCity should be working in Tomcat, IIS should not deal with the TemCity resources on disk in any way.


You _must_ nominate a home directory for a website in IIS 6. Plus, from what I have read about Tomcat/IIS it seems like a good idea to have IIS point at the same disk location as that which Tomcat is serving. Then IIS can serve static content like images and js files without having to push the request through tomcat. This seems logical, but perhaps I have misunderstood?

Thanks for your assistance with this.

L

0

> TeamCity works fine when I reach it at http://myserver:8083

OK, then the rest is pure IIS configuration issue.

Unfortunately, we have no experience with settin up IIS.

> Then IIS can serve static content like images and js files without having to push the request through tomcat.

I'd at least begin to start without tangling IIS and Tomcat web applicaiton on the disk level.

Seems, you need to dive deper into IIS redirection configuration and this seems to be not a TeamCity-specific task, so there should be pretty many resources on that.

0

yaegor wrote:

Seems, you need to dive deper into IIS redirection configuration and this seems to be not a TeamCity-specific task, so there should be pretty many resources on that.


Not as many as you would think. If I do figure it out I'll post the solution on this thread.

Cheers anyway.

0

Hi Lee,

I know you have stated that you are using IIS6 however if you have access to an IIS7 box on the same network you can use a Microsoft web plug in called "Application Request Routing".

It allows you to route requests through to urls either hosted on local or remote environments.

http://www.charlesstrahan.com/blog/2010/09/30/configuring-teamcity-in-iis-7-5/

http://dannybaggs.wordpress.com/2010/05/14/iis7-tomcat-application-request-routing/
http://jonalb.com/post/2010/10/23/TeamCity-On-Port-80-In-IIS.aspx

0

You can try to use my BonCode connector for IIS instead of the Apache ISAPI based connector.

Outline on how to do so is in this post:

http://devnet.jetbrains.net/message/5309095

Please report any issues on the project website.

Best,

B.

0

I have TeamCity over IIS i'm using URLRewrite with Reverse Proxy rule. This works well.

0

Please sign in to leave a comment.