I spent a couple of hours trying to figure out why the Tomcat service of a fresh installation of TeamCity Professional was continuously crashing each time I tried to open the administration console in the browser.
I couldn’t find any useful log of information for that (I’m not really a Tomcat/Apache fan nor expert) so what I did was to open the services configuration from the control panel and to allow the ‘TeamCity Web Server’ service to interact with the desktop.
In this way I was able to see the command prompt window with all the action that the service was going to take. So I realized that the service (on my machine) takes really a long time to startup (like 2-3 minutes) and that at the first request I made, he crashed out with an error regarding the binding of the address and the port.
So I had an illumination...I was smart enough to enter an unused port for the TeamCity server during the installation...BUT...an error on port and address binding may only mean that something else is using the same configuration.
I started checking all the installed programs with a web administration console and I found that VMware on the same machine used a Tomcat/Apache server too, so I opened up both of the ‘server.xml’ tomcat configuration files (you can find them in the ‘conf’ folder of your installations) and I found that internally they both used the same port 8443 to which all the other were redirected.
VMware code snippet:
<Connector port="8308" protocol="HTTP/1.1"
TeamCity code snippet:
<Connector port="8111" protocol="HTTP/1.1"
What you have to do in order to have both working on the same machine is to change the redirect port to a different - unused - value in one of the two configuration files.
To be completely safe I just changed each port number that were the same in both files, just look for everything that looks like ‘port=’ and change the value there.
In the end: if you have multiple instances of Tomcat running on a same machine and you have troubles with the websites they host, go check the ‘Server.xml’ configuration file of each installation and make sure you do not have port conflicts there.
- Playing with Profilers - always take a look at your most called functions! (08/05/2010)
- More related document (1)