如何在macos中更改安装jenkins的brew的默认端口?

t8e9dugd  于 11个月前  发布在  Jenkins
关注(0)|答案(2)|浏览(241)

在macbook pro jenkins-lts 2.492.2安装brew与默认端口8080,但端口8080是其他应用程序的默认端口,所以我想改变Jenkins默认端口像7070 0 r 8888。

i2byvkas

i2byvkas1#

您可以通过编辑Jenkins plist文件来更改端口。
它存储的位置可能会有所不同,但我在这里找到了该文件:
/opt/homebrew/Cellar/jenkins-lts/2.289.2/homebrew.mxcl.jenkins-lts.plist
MacBook Pro M1(2020)

li9yvcax

li9yvcax2#

**This solution for macos based jenkins installation with brew**
    
    the Jenkins port on macOS,you must pay attention to the way of installation of Jenkins.
    
    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.492.2/homebrew.mxcl.jenkins-lts.plist
    
    You can modify the httpPort value from default 8080 to the other value,and then save the file.
    as shown below
    
    **vi homebrew.mxcl.jenkins-lts.plist**
    
    
    <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>homebrew.mxcl.jenkins-lts</string>
    <key>ProgramArguments</key>
    <array>
      <string>/usr/local/opt/openjdk@11/bin/java</string>
      <string>-Dmail.smtp.starttls.enable=true</string>
      <string>-jar</string>
      <string>/usr/local/opt/jenkins-lts/libexec/jenkins.war</string>
      <string>--httpListenAddress=127.0.0.1</string>
      <string>--httpPort=7070</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
  </dict>
</plist>
    
    You must try these commands(specific to macos) to restart your Jenkins and make the port modification works.
    
    
        brew services stop jenkins-lts
        brew services start jenkins-lts
        
        prkumar@KLL34873 ~ % brew services stop jenkins-lts
        Stopping `jenkins-lts`... (might take a while)
        ==> Successfully stopped `jenkins-lts` (label: homebrew.mxcl.jenkins-lts)
        prkumar@KLL34873 ~ % 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.

字符串

相关问题