Alias server URL
Hi,
I'm sure this must have been discussed before, but I can't find it:
I would like our TeamCity users to go to this URL when accessing our TeamCity server: http://teamcity.domain.com
rather than this URL: http://machinename.domain.com:8111
Is there an easy way to do this? I tried changing the server URL in admin but that did not seem to work.
Thanks,
-Dave
Please sign in to leave a comment.
Try to use 80 port. This is default port for web server.
Using port 80 doesn't work for me as I have Apache running on the same machine using that port.
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.
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
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.
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.
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....
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!
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.
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).