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

后端 未结 16 858
我在风中等你
我在风中等你 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:22

    If you have configured jenkins on ec2 instance with linux AMI and looking to change the port. Edit the file at

    sudo vi /etc/sysconfig/jenkins
    

    Edit

    JENKINS_PORT="your port number"
    

    Exit vim

    :wq
    

    Restart jenkins

    sudo service jenkins restart
    

    Or simply start it, if its not already running

    sudo service jenkins start
    

    To verify if your jenkins is running on mentioned port

    netstat -lntu | grep "your port number"
    
    0 讨论(0)
  • 2020-12-04 08:23

    With Ubuntu 14.4 I had to change the file /etc/default/jenkins

    E.g.

       #HTTP_PORT=8080
       HTTP_PORT=8083
    

    and restart the service

    service jenkins restart

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

    For Fedora, RedHat, CentOS and alike, any customization should be done within /etc/sysconfig/jenkins instead of /etc/init.d/jenkins. The purpose of the first file is exactly the customization of the second file.

    So, within /etc/sysconfig/jenkins, there is a the JENKINS_PORT variable that holds the port number on which Jenkins is running.

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

    You can call

    java -jar jenkins.war --help
    

    to see a list of all available parameters.

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

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

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

    Change 8080 to whichever you want

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

    In *nix In CentOS/RedHat

    vim /etc/sysconfig/jenkins

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

    In windows open XML file C:\Program Files (x86)\Jenkins\jenkins.xml

    <executable>%BASE%\jre\bin\java</executable>
      <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --**httpPort=8083**</arguments>
     i made  above bold  to show you change then 
     <executable>%BASE%\jre\bin\java</executable>
      <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8083</arguments>
    

    now you have to restart it doesnot work unless you restart http://localhost:8080/restart then after restart http://localhost:8083/ all should be well so looks like the all above response which says it does not work We have restart.

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