Hello,
I am not sure if this is the right forum to raise this question.
Please redirect as appropriate.
I want to run Jenkins running the WAR file directly (https://www.jenkins.io/doc/book/installing/#war-file) as a daemonized process.
I see that there are some arguments that allow to change the port the web app is running on, as well as the prefix. These are, --httpPort and --prefix, respectively. I can see this running: java -jar jenkins.war --help
--httpPort = set the http listening port. -1 to disable, Default is 8080
--prefix = add this prefix to all URLs (eg http://localhost:8080/prefix/resource). Default is none
--daemon = fork into background and run as
daemon (Unix only)
So this is the command I ran:
java -jar jenkins.war --httpPort=16644
--prefix=jenkins-7521 --daemon
I can see this is running:
$ ps -ef | grep jenkins
username 3690 1 1 06:55 ? 00:00:14 java
-Dcom.sun.akuma.Daemon=daemonized -jar jenkins.war
--httpPort=16644 --prefix=jenkins-7521 --daemon
However, I get a 404 when trying to access the application both from a browser and using curl.
$ curl http://10.51.20.222:16644/jenkins-7521/login
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr><th>URI:</th><td>/jenkins-7521/login</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Not
Found</td></tr>
<tr><th>SERVLET:</th><td>-</td></tr>
</table>
<hr><a
href="http://eclipse.org/jetty">Powered by Jetty://
9.4.30.v20200611</a><hr/>
</body>
</html>
I've seen a mention in this thread (https://stackoverflow.com/questions/9685782/can-not-access-jenkins-by-prefix-value-even-if-prefix-is-set) to altering the JENKINS_ARGS and alter the prefix, however I think this only applies when running the Jenkins application through yum (Jenkins is run as a service). I can't find a mention to JENKINS_ARGS in the .jenkins subfolder made in the $HOME of the user that runs the java command:
$ pwd
/home/username/.jenkins
$ grep -R 'JENKINS_ARGS'
$
Any ideas on what's going on?
Version details
jenkins.war is 2.249.1 LTS
$ java -version
openjdk version "1.8.0_161"
OpenJDK Runtime Environment (build 1.8.0_161-b14)
OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)
$ uname -a
Linux ab-rhel 3.10.0-862.el7.x86_64 #1 SMP Wed Mar 21
18:14:51 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux
Thanks,
Juan Eiros