Posts Tagged ‘TeamCity’

Reverse Proxy & Teamcity

Monday, December 14th, 2009

Today I was upgrading my TeamCity build server to the latest one (5.0). Before, I had my 4.5 version installed on a Tomcat. Mainly because I wanted to do some reverse proxying and therefore you need to be able to access TeamCity like this:


http://localhost:8080/teamcity

So deploying it as a war seemed me the easiest way to accomplish this.

However, today I found out there is a nicer way: you can define several context elements in a host element in Tomcat. So, this time I downloaded the standalone version and changed the server.xml in the conf folder. The result looks like this (just the host section):

<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<Context path="/teamcity" docBase="/usr/local/teamcity/webapps/ROOT"
debug="1" reloadable="true" />

<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
-->
</Host>

So now, I can add in my Apache sites configuration the following two lines:

ProxyPass /teamcity http://localhost:8111/teamcity
ProxyPassReverse /teamcity http://localhost:8111/teamcity