10 comments
Comment actions Permalink

Try to use 80 port. This is default port for web server.

0
Comment actions Permalink

Using port 80 doesn't work for me as I have Apache running on the same machine using that port.

0
Comment actions Permalink

I agree.

A really acceptable solution is to know how to setup the tomcat server to listen to the internal IP address (port 80) AND a hostname header of "teamcity.domain.com"

Unfortunately, I know how to do that in apache httpd server but I have no idea about how to do it in tomcat.

0
Comment actions Permalink

It is possible to use Tomcat behind the Apache server with help of mod_jk Apache module and AJP Tomcat connector. Please refer to this:http://tomcat.apache.org/tomcat-6.0-doc/connectors.html and http://tomcat.apache.org/connectors-doc/reference/apache.html

0
Comment actions Permalink

Thanks, but as I wrote, I am not a tomcat guru. So could you guide me a little bit?

I cannot find the jkconf file and moreover all my attempts to create a 'default' one failed.

0
Comment actions Permalink

Well, I did make such configuration quite some time ago and I can only provide general instructions.

First of all you need to install mod_jk into the apache server. Then you can uncomment AJP connector in the Tomcat server.xml file (and comment out HTTP connector). Next you configure workers file in the apache server. This file describes available Tomcat instances and their names. In your case you have one instance. Then you can define virtual host in the apache server and mount (JkMount) corresponding worker, something like:
JkMount /* TeamcityTomcat

Since Apache+Tomcat configuration is not easy, I suggest to enable logging in the apache to monitor what happens.

0
Comment actions Permalink

Finally, I've decided to choose the reverse proxy way.
It is only based on the apache configuration.

First of all, note that my teamcity server is accessible (in my internal network) by the following URL: http://ender:8800
So I update the httpd.conf file as follow:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so


and create my virtual host :

NameVirtualHost *:80

<VirtualHost *:80>
    ProxyPreserveHost On
    ProxyPass / http://ender:8800/
    ProxyPassReverse / http://ender:8800/
    ServerName teamcity.<mydomain>.<tld>
    ServerAdmin buildmaster@<mydomain>.<tld>

</VirtualHost>


Now it works, but it seems to be too easy, so I wonder if I don't forget something....

0
Comment actions Permalink

Well since you are using ProxyPassReverse directive this setup should work and it is much simpler then mod_jk. The only problem which could happen is absolute URL somewhere in the TeamCity UI, but there shall not be such URLs. Seems like we need to update our FAQ. Thank you!


0
Comment actions Permalink

Hmm. This did not work for me. The only instance of an absolute URL that I could find was in: main-config.xml where "server rootURL" is set to the absolute URL.

Should it be? This is on a RedHat box, btw.

0
Comment actions Permalink

Server URL specified in the main-config file is used mainly in notifications because TeamCIty server itself is not able to determine URL by which users will communicate with it (in particular because users can come via various proxy servers).

0

Please sign in to leave a comment.