How to start jenkins on different port rather than

2019-01-16 03:24发布

I have jenkins.war and I started it from command prompt in Windows as:

java -jar jenkins.war

It was started well and easily browsed as http://localhost:8080

I want to start on 9090 port. How can I do that?

14条回答
Rolldiameter
2楼-- · 2019-01-16 03:59

Add the following two lines after DAEMON_ARGS in the file /etc/init.d/jenkins

HTTP_PORT=8010
JENKINS_ARGS="--httpPort=$HTTP_PORT"

查看更多
再贱就再见
3楼-- · 2019-01-16 04:00

Use the following command at command prompt:

java -jar jenkins.war --httpPort=9090

If you want to use https use the following command:

java -jar jenkins.war --httpsPort=9090

Details are here

查看更多
淡お忘
4楼-- · 2019-01-16 04:01

For the benefit of Linux users who find themselves here: I found /etc/sysconfig/jenkins has a JENKINS_PORT="8080", which you should probably change too.

查看更多
迷人小祖宗
5楼-- · 2019-01-16 04:01

You can call

java -jar jenkins.war --help

to see a list of all available parameters.

查看更多
混吃等死
6楼-- · 2019-01-16 04:02

Correct, use --httpPort parameter. If you also want to specify the $JENKINS_HOME, you can do like this:

java -DJENKINS_HOME=/Users/Heros/jenkins -jar jenkins.war  --httpPort=8484
查看更多
贼婆χ
7楼-- · 2019-01-16 04:02

Change the '/etc/init.d/jenkins' shell

check_tcp_port "http" "$HTTP_PORT" "8080" || return 1

Change 8080 to whichever you want

查看更多
登录 后发表回答