How to start jenkins on different port rather than 8080 using command prompt in Windows?

后端 未结 16 856
我在风中等你
我在风中等你 2020-12-04 08:02

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

相关标签:
16条回答
  • 2020-12-04 08:10

    Open Command Prompt as Administrator in Windows . Go to the directory where Jenkins is installed. and stop the Jenkins service first, using jenkins.exe stop

    type the command to change the port using, java -jar jenkins.war --httpPort=9090 (enter the port number you want to use).

    and at-last, restart the Jenkins services, using jenkins.exe restart

    0 讨论(0)
  • 2020-12-04 08:14

    To change the default port of 8080. All you need to do:

    1. Goto Jenkins folder present in C:\Program Files (x86)
    2. Open a notepad or text pad and run them as administrator and then try opening the jenkins.xml file present in the jenkins folder.
    3. Change the port number as below: <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=9090</arguments>
    4. Click Save.
    0 讨论(0)
  • 2020-12-04 08:16

    In CentOS/RedHat (assuming you installed the jenkins package)

    vim /etc/sysconfig/jenkins

    ....
    # Port Jenkins is listening on.
    # Set to -1 to disable
    #
    JENKINS_PORT="8080"
    

    change it to any port you want.

    0 讨论(0)
  • 2020-12-04 08:18

    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
    
    0 讨论(0)
  • 2020-12-04 08:19

    On OSX edit file:

    /usr/local/Cellar/jenkins-lts/2.46.1/homebrew.mxcl.jenkins-lts.plist
    

    and edit port to you needs.

    0 讨论(0)
  • 2020-12-04 08:22

    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.

    0 讨论(0)
提交回复
热议问题