Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

With default Ubuntu/Debian installation of Jenkins, is there an easy way to change the deployment path? I'd like Jenkins to be available somewhere like http://localhost:8090/foobar

I'm looking for a way to configure it in /etc/default/jenkins, similarly to setting the HTTP port:

# port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8090

/etc/default/jenkins contains this bit which seems related, but I'm not sure how to use it:

# servlet context, important if you want to use apache proxying  
PREFIX=/jenkins
share|improve this question

1 Answer 1

up vote 1 down vote accepted

Ah, looking at /etc/default/jenkins a bit more, this turned out very easy.

The end of /etc/default/jenkins looks like this by default:

# servlet context, important if you want to use apache proxying  
PREFIX=/jenkins

# arguments to pass to jenkins.
# --javahome=$JAVA_HOME
# --httpPort=$HTTP_PORT (default 8080; disable with -1)
# --httpsPort=$HTTP_PORT
# --ajp13Port=$AJP_PORT
# --argumentsRealm.passwd.$ADMIN_USER=[password]
# --argumentsRealm.roles.$ADMIN_USER=admin
# --webroot=~/.jenkins/war
# --prefix=$PREFIX

JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT"

So, you only need to set PREFIX to your liking, and edit JENKINS_ARGS to contain --prefix=$PREFIX. So JENKINS_ARGS would be something like:

 JENKINS_ARGS="--webroot=/var/cache/jenkins/war --prefix=$PREFIX --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT"
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.