Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins website root path

Tags:

jenkins

I'm trying to follow the directions here: https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache to set up my Jenkins server to appear at http://myhost/jenkins. It works, but the Jenkins website thinks http://myhost/ is the jenkins/ root.

I believe this problem is caused by the first warning flag on that web page, i.e. that my context path is not set correctly. However, I can't figure out where to set the context path. The instructions for ubuntu and windows are clear enough, but on Mac OS X 10.6, there is no jenkins.xml file, no /etc/default/jenkins file, and nothing of relevance I can see in ~/.jenkins/config.xml.

So, what am I missing? Where can I tell jenkins that its root is in /jenkins/ instead of /?

like image 741
keflavich Avatar asked Feb 01 '12 01:02

keflavich


People also ask

What is Jenkins root URL?

In Jenkins 2.150 the Jenkins root URL is defined by the Jenkins URL item in the Jenkins Location section of the /configure page. – ottomeister. Mar 12, 2019 at 2:11. 2. Kind of made you wish that the alert and the actual setting naming should match.

How do I find my Jenkins server URL?

Fixing a root urlGo to Jenkins > Manage Jenkins > Configure System, and locate the section titled "Jenkins Location". You should see the warning here as well.


2 Answers

Paraphrasing from the document you mentioned;

You need to specify the context/prefix of the Jenkins instance, this can be done by modifying the Jenkins configuration as follows; Either, set the context path by modifying the jenkins.xml configuration file and adding --prefix=/jenkins (or similar) to the entry. Or Set the context path when using by adding --prefix=/jenkins to JENKINS_ARGS in /etc/default/jenkins (Ubuntu) or in an appropriate startup file.

So, how to find these things...

The Jenkins.xml file should be in the $JENKINS_HOME directory, I'm not sure if Mac OS has the "updatedb" and "locate " commands, but you could try doing updatedb && locate jenkins.xml

Also, have a look in the startup scripts; /etc/init.d if installed from a package, or add the JENKINS_ARGS to the environment properties for the User running Jenkins (append to ~user/.profile) or the arguments for the container running Jenkins.


Be aware that if your Jenkins installation (without the prefix argument) was running under:

http://myserver:8080/ => 200 Jenkins is here

adding --prefix=/ci/dashboard in the arguments will produce this behaviour:

http://myserver:8080/ => 404
http://myserver:8080/ci/dashboard => 200 Jenkins is now here
like image 128
Toby Jackson Avatar answered Sep 23 '22 07:09

Toby Jackson


Not sure where to look in config.xml, but at http://myhost/jenkins/configure, there's an option called "Jenkins URL" that you can use to set that.

like image 14
sblom Avatar answered Sep 23 '22 07:09

sblom