How to run CruiseControl under tomcat instead of jetty
As helpfully described here:
To make the CC reporting app from 2.6.1 run under Tomcat, do the following:
- In webapps/cruisecontrol/WEB-INF/web.xml, make the following changes:
<param-value>logs</param-value> change to: <param-value>/full/path/to/your/cruisecontrol/logs/folder</param-value> in the ArtifactServlet section: <init-param> <param-name>rootDir</param-name> <param-value>artifacts</param-value> </init-param> change to: <init-param> <param-name>rootDir</param-name> <param-value>/full/path/to/your/cruisecontrol/artifacts/folder</param-value> </init-param>
Also change the cruisecontrol.jmxport and cruisecontrol.jmxhost if necessary, to point to the right port and host if Tomcat is running on a different IP to CruiseControl (hint: the jmxhost section is commented out, so decomment it)
- Now check that it all still works the same way as it did before. All you have done so faris specified exact paths/host/port instead of relying on the defaults, so everything should still work the same way (still running from Jetty).
- In cruisecontrol.sh, in the EXEC= line, remove "-webport 8080", to prevent Jetty from starting.
Restart CruiseControl, and verify that it is no longer listening on port 8080 (or wherever it was listening on before).
Next, in <tomcat>/conf/server.xml, change the Host element as follows:
<Host name="localhost" appBase="webapps" debug="3"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Host name="localhost" appBase="/path/to/your/webapps/folder"
debug="3" unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
Restart tomcat, and tomcat will now serve up the cruisecontrol application instead of Jetty doing it: http://localhost:8080/cruisecontrol
- Tomcat will also deploy any other application in the webapps folder automatically. So you can deploy your app there after building, using an artifact publisher or other method, to double as a staging area. You can also then run things like httpunit against it etc...
For other config info on Tomcat, such as adding the SSL support and making it listen on a different host than localhost, see the Tomcat documentation.
