Set JENKINS_HOME in Tomcat7?

Posted by C. Ross on Server Fault See other posts from Server Fault or by C. Ross
Published on 2012-12-21T15:17:01Z Indexed on 2013/11/04 21:57 UTC
Read the original article Hit count: 722

Filed under:
|

I'm trying to set up Jenkins in Tomcat7 on Ubuntu. I installed Tomcat7 and deployed jenkins.war, and I now see the Jenkins home page at http://myhost:8080/jenkins, but it's attempting to create the Jenkins directory at /usr/share/tomcat7/.jenkins, which it can't for security reasons. I've already created /srv/jenkins and given the tomcat7 group permissions, and want to set JENKINS_HOME to that path. I've tried adding it to the tomcat configuration in /etc/tomcat7/server.xml:

<GlobalNamingResources>

  <Environment name="JENKINS_HOME" value="/srv/jenkins"
       type="java.lang.String" override="false"/>
  <!-- Default settings -->

And I've also tried adding it to the automatically created context file in ROOT/META-INF/context.xml (there is no $CATALINA_HOME/conf as far as I can tell).

<Context path="/"
        antiResourceLocking="false" >
    <Environment name="JENKINS_HOME" value="/srv/jenkins/" type="java.lang.String"/>
</Context>

But even after restarting tomcat7 I still get the same result (trying to use /usr/share/tomcat7/.jenkins).

Where do I need to set the environment variable for JENKINS_HOME in Tomcat7?

© Server Fault or respective owner

Related posts about jenkins

Related posts about tomcat7