Jenkins server is not accessible by host name (ip address)

后端 未结 5 1554
终归单人心
终归单人心 2020-12-08 04:57

I setup jenkins on my Mac OS X with homebrew and it works just fine via http://localhost:8080 or http://127.0.0.1:8080 I couldn\'t access jenkins i

相关标签:
5条回答
  • 2020-12-08 05:40

    It turned out that launch agent was configured to listen only 127.0.0.1 (or localhost). To fixed that edit jenkins agent's plist:

    nano /Users/admin/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
    

    and modify httpListenAddress to 0.0.0.0 instead of 127.0.0.1

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs$
    <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>homebrew.mxcl.jenkins</string>
        <key>ProgramArguments</key>
        <array>
          <string>/usr/bin/java</string>
          <string>-Dmail.smtp.starttls.enable=true</string>
          <string>-jar</string>
          <string>/usr/local/opt/jenkins/libexec/jenkins.war</string>
          <string>--httpListenAddress=0.0.0.0</string>
          <string>--httpPort=8080</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
      </dict>
    </plist>
    
    0 讨论(0)
  • 2020-12-08 05:41

    The correct location of the file to edit is /usr/local/opt/jenkins/homebrew.mxcl.jenkins.plist

    Found the answer here

    0 讨论(0)
  • 2020-12-08 05:51

    If your Jenkins running through Homebrew (macos), don't touch /Users/admin/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

    Use this one: /usr/local/Cellar/jenkins/2.xxx/homebrew.mxcl.jenkins.plist

    Change httpListenAddress to 0.0.0.0

    0 讨论(0)
  • 2020-12-08 05:53

    By starting jenkins using sudo /etc/init.d/jenkins restart instead of sudo service jenkins start started the browser access. I hope it will be helpful.

    0 讨论(0)
  • 2020-12-08 05:53

    I came across something like this but, it was for windows,I'm sure the steps to resolve will be the same,Please give it a try: https://apple.stackexchange.com/questions/31376/how-can-i-open-port-8080-of-mac-os-x-lion

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