RequirementsYou need Tomcat 5.0 or later. InstallationTo install Hudson on Tomcat, simply copy hudson.war to $TOMCAT_HOME/webapps, then access http://yourhost/hudson. If you are running Tomcat just to host Hudson, then remove everything from $TOMCAT_HOME/webapps, and place hudson.war as ROOT.war. Tomcat should expand this and create the ROOT directory, and you should see Hudson in http://yourhost (if you accepted the Tomcat defaults - http://yourhost:8080) without any additional path. This also works nicely when you set up a virtual host, as it allows a single Tomcat instance to run multiple applications, yet users can still access your hudson with URLs like http://hudson.acme.org/ without any additional path. See the Tomcat documentation for more about how to set up a virtual host. UpgradeSimply overwrite your hudson.war with the new version. Tomcat should automatically redeploy the application. Setting HUDSON_HOMEBefore starting Tomcat, set CATALINA_OPTS like this. This can be also used to specify JVM options to increase the heap size: $ export CATALINA_OPTS="-DHUDSON_HOME=/path/to/hudson_home/ -Xmx512m" $ catalina.sh start Or if that fails for some reason, you should still be able to use the environment variable: $ export HUDSON_HOME=/path/to/hudson_home/ $ catalina.sh start Securing Hudson on TomcatTomcat by default stores the user database in an XML file called $TOMCAT_HOME/conf/tomcat-users.xml. You can add the following lines to this file to create an admin user. <role rolename="admin"/> <user username="hudson-admin" password="secret" roles="admin"/> i18nSome versions of Tomcat (such as 5.0.28) uses iso-8859-1 to decode URLs, which is in a clear violation of the relevant RFCs. To fix this problem, add the following URIEncoding attribute to the connector definition in $TOMCAT_HOME/conf/server.xml. <Connector port="8080" URIEncoding="UTF-8"/> Other people reported that a presence of RequestDumperValve would also cause a problem. Related reads
Relevant IssuesSee the list of issues filed that are specifically marked relevant to Tomcat. Tomcat from XAMPPIf you are using XAMPP's tomcat installation, and you have Java > 1.5, then you need to remove the following jars from the common\lib directory, otherwise you will get FileNotFound exceptions from the changelog.xml generator: xalan.jar xercesImpl.jar xercesSamples.jar Tomcat from UbuntuIf you get Tomcat from Ubuntu via apt-get, Hudson will report an error citing the security permission issue. This is because Tomcat in Ubuntu comes with the security manager on by default. This can be disabled by modifying /etc/default/tomcat5 (version number will be different depending on which version of Tomcat you install.) See issue #719 for more details. Tomcat from DebianFix security issues adding the next lines at /etc/tomcat5.5/policy.d/04webapps.policy: grant codeBase "file:/var/lib/tomcat5.5/webapps/hudson/-" {
permission java.security.AllPermission;
};
Set Hudson home at file /etc/default/tomcat5.5: CATALINA_OPTS="-DHUDSON_HOME=/var/lib/tomcat5.5/webapps/hudson/" Tomcat from WindowsGUI Testing in WindowsMost Windows services -- including those run with the option "Allow service to interact with desktop" in Windows XP and Vista -- do not have access to many of the computer's resources, including the console display. This may cause Automated GUI Tests to fail if you are running Apache Tomcat as a Windows Service and are doing any GUI testing. This is true at least for AWT and Abbot frameworks. A typical error might look similar to this: [junit] # An unexpected error has been detected by HotSpot Virtual Machine: This limitation can be resolved by not running Tomcat as a Windows Service, but instead through a "Scheduled Task" as an Application that runs at logon. There are several options for doing this, an example would be to run "$TOMCAT_HOME\bin\tomcat5.exe". When setting up the scheduled task in Windows Vista consider choosing the check-box for "Run with highest privileges" from the general tab, as this removes the need to always provide administrator privileges and may resolve other issues as well. |

Comments (9)
Dec 09, 2008
djcarr says:
Is there a way to restart the hudson process without restarting Tomcat? The Act...Is there a way to restart the hudson process without restarting Tomcat?
The Active Directory plugin doesn't seem to like Tomcat being restarted (see https://hudson.dev.java.net/issues/show_bug.cgi?id=2708 ).
May 19, 2009
David Aldrich says:
I think the Upgrade paragraph is incorrect. Tomcat documentation states: "If yo...I think the Upgrade paragraph is incorrect. Tomcat documentation states:
"If you redeploy an updated WAR file, be sure to delete the expanded directory when restarting Tomcat, so that the updated WAR file will be re-expanded (note that the auto deployer, if enabled, will automatically expand the updated WAR file once the previously expanded directory is removed)."
So you must delete the hudson folder for the new war to be expanded.
Jul 25, 2009
Luca Candela says:
One note: windows users might not be aware that ROOT.war is case sensitive, so m...One note: windows users might not be aware that ROOT.war is case sensitive, so make sure you rename hudson.war to ROOT.war (and not root.war or Root.war) or it will not work. Just adding this because it took me 20 minutes to figure out what's wrong and might be saving the hassle to the next person with the same problem.
Aug 10
Jonathan Clarke says:
The section on "Tomcat from Debian" suggests setting: HUDSON_HOME=/var/lib/tomc...The section on "Tomcat from Debian" suggests setting:
This is really not a good idea, since this directory is where the Hudson WAR is deployed - so when upgrading, it (and all your configuration) will be deleted!
Use some other directory, not under the webapps directory.
Sep 17
Chris Swingler says:
@djcarr: You should be able to use the Tomcat Manager to reload a webapp witho...@djcarr:
You should be able to use the Tomcat Manager to reload a webapp without restarting Tomcat.Try http://yourhost/manager/html. ; You may need to set up a manager user.
See http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html
Sep 24
westfox says:
For windows tomcat 5.5 or later , using apache tomcat monitor to config tomcat, ...For windows tomcat 5.5 or later , using apache tomcat monitor to config tomcat, tab "Java", "java options" add "-DHUDSON_HOME=<path to you want>" is OK.
Oct 26
Alejandro Pérez García says:
I wrote a Spanish tutorial about the instalation and first steps on Tomcat &nbs...I wrote a Spanish tutorial about the instalation and first steps on Tomcat
http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=hudsonInstalacionTomcat
He escrito un tutorial en Español sobre la instalación y primeros pasos en Tomcat
http://www.adictosaltrabajo.com/tutoriales/tutoriales.php?pagina=hudsonInstalacionTomcat
Nov 17
Kenneth P. Turvey says:
I wrote a tutorial on installing hudson to use git and grails, but it also inclu...I wrote a tutorial on installing hudson to use git and grails, but it also includes all the information necessary to get it working with Tomcat under Ubuntu:
http://www.electricsenator.net/2009/10/03/1254618530821.html
Dec 07
dupuis christophe says:
I upgraded the latest Hudson version 1.336 (from 1.332 but I'm not sure). Upgra...I upgraded the latest Hudson version 1.336 (from 1.332 but I'm not sure).
Upgrade is working, all jobs are found, but my plugins disappeared in graphical Hudson tool.In <HUDSON_HOME> directory, all my plugins are still present.
I tried following things without success (with and without stop/start hudson):
So, how to see and use my plugins in graphical Hudson tool?