Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup TeamCity under IIS? [closed]

Any ideas?

like image 548
omoto Avatar asked May 13 '09 15:05

omoto


2 Answers

With IIS 7.5 you can use Application Request Routing to route requests at teamcity.server.domain.com:80 to Tomcat at server.domain.com:81. I would consider this approach superior since the Tomcat Connector seems a bit flaky under WS2008 x64.

Jon Alb has a good writeup on how to configure TeamCity plus IIS on WS2008:

  • Part1
  • Part2

Additionally, you need to ensure that your DNS can resolve teamcity.server.domain.com to server.domain.com. My IIS server needed a ipconfig /registerdns to update its DNS entry correctly. Correctly means in this case to create a Domain entry in the domain.com lookup zone for server, a simple A-Record does not suffice. In that domain, you need to create a CNAME record for * , so any subdomain will be redirected to server.domain.com

A big problem I ran into is that IIS 7.5 seems to no longer correctly write the applicationHost.config file, so the port number won't endup being persisted. This will result in a nasty 400.0 Bad Request error because the MAX_FORWARDS limit will be reached (the request is rooted in circles).

To fix this, add the following to C:\Windows\System32\inetsrv\config:

<webFarms>
  <webFarm name="teamcity" enabled="true" adminUserName="" adminPassword="[enc:AesProvider:2blZ7roifGTktpn8zBBuVQ==:enc]" primaryServer="">
    <server address="localhost" enabled="true">
      <applicationRequestRouting httpPort="YOURPORTHERE!!!" />
    </server>
    <applicationRequestRouting>
      <loadBalancing algorithm="WeightedRoundRobin" />
      <protocol reverseRewriteHostInResponseHeaders="true" />
    </applicationRequestRouting>
  </webFarm>
</webFarms>

Edit If you are running other sites, and getting a 404, besides following Part 2 you need to create a dummy site to catch the hostname as the below Ian Patrick Hughes answer states.

like image 117
Johannes Rudolph Avatar answered Sep 21 '22 11:09

Johannes Rudolph


A Step by Step Guide to Hosting TeamCity in IIS 7

http://blog.endjin.com/2010/11/a-step-by-step-guide-to-hosting-teamcity-in-iis-7/

like image 30
superlogical Avatar answered Sep 18 '22 11:09

superlogical