Cannot access Jenkins by using -prefix even if --prefix is ​​specified

I set JENKINS_ARGS with / etc / default / jenkins and started jenkins as a daemon with www-data user.

The system information page shows that --prefix = / jenkins is installed

HOME / var / www HUDSON_HOME / var / jenkins JENKINS_ARGS --prefix = / jenkins

But still, Jenkins is only available through http: // ip: port / , and not http: // ip: port / jenkin .

I also set the Jenkins URL on the configuration page, but to no avail.

Do you know if there is anything else that I should do?

This is my environment: Linux robopar12227 2.6.35-22-server # 35-Ubuntu SMP Sat Oct 16 10:02:33 UTC 2010 x86_64 GNU / Linux java version "1.6.0_20" OpenJDK working environment (IcedTea6 1.9.13) ( 6b20-1.9.13-0ubuntu1 ~ 10.10.1) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode) Jenkins ver. 1.447

+6
source share
5 answers

Add the prefix to / etc / default / jenkins like this:

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

and reboot jenkins server

tried Debian / Ubuntu

+10
source

I have jenkins on my CentOS system, try the following:

  • change / etc / sysconfig / jenkins, change this line (last line) JENKINS_ARGS = "to JENKINS_ARGS =" - prefix = / jenkins "(double hyphen)

  • invoke, sudo service jenkins restart

  • depending on which port (8080 by default - can be changed in the same file), you are using jenkins, you can view "http: //: 8080 / jenkins"

+6
source

I found this page struggling with the same problem. Strange for me setting the PREFIX variable to / etc / default / jenkins did not work, but manually added the prefix flag to JENKINS_ARGS, for example

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

worked for me.

+1
source

Look in this document - find the words, the Jenkins context path should be the same between your Apache and Jenkins. Hope this helps.

0
source

Just in case, someone, like me, reaches this point, trying to find a way to set the prefix when starting Jenkins offline:

Just add --prefix=/jenkins to the command line that you use to start the server.
Something like the following:

 nohup java -jar jenkins.war --prefix=/jenkins > /var/log/jenkins/log 2>&1 & 

As malenkiy_scot points out in the first comment on the question , the configuration URL is for creating Jenkins, not for setting a prefix that you can access. from.

0
source

Source: https://habr.com/ru/post/910602/


All Articles