Change Jenkins port on macOS

前端 未结 7 2096
南笙
南笙 2020-12-23 02:11

I was wondering how one could change Jenkins\' default port 8080. Using linux or windows, this is simply done with the configuration file. But the Mac config file of Jenkins

7条回答
  •  臣服心动
    2020-12-23 02:31

    Before modify the Jenkins port on macOS,you must pay attention to the way of installation of Jenkins.

    Here I recommend you install Jenkins by 'Homebrew' if you want to deal with iOS project building,because you may meet some errors that the way of using .pkg to install,it's really hard to solve the problems.

    I have installed Jenkins LTS by brew command:

    brew install jenkins-lts

    So my Jenkins plist file is here:

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

    You can modify the httpPort value from default 8080 to the other value,and then save the file.

    Label homebrew.mxcl.jenkins-lts ProgramArguments /usr/libexec/java_home -v 1.8 --exec java -Dmail.smtp.starttls.enable=true -jar /usr/local/opt/jenkins-lts/libexec/jenkins.war --httpListenAddress=127.0.0.1 --httpPort=8383 RunAtLoad

    sudo launchctl unload command will not work for you.You must try these commands to restart your Jenkins and make the port modification works.

    brew services stop jenkins-lts brew services start jenkins-lts

    ifeegoo:~ ifeegoo$ brew services stop jenkins-lts Stopping `jenkins-lts`... (might take a while) ==> Successfully stopped `jenkins-lts` (label: homebrew.mxcl.jenkins-lts) ifeegoo:~ ifeegoo$ brew services start jenkins-lts ==> Successfully started `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)

    Note:If you installed Jenkins LTS,you must pay attention that your command must be jenkins-lts,not jenkins.

提交回复
热议问题