Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
805 views
in Technique[技术] by (71.8m points)

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

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 instance via hostname/ipaddress:

 1. http://myjenkinshost.local:8080
 2. http://192.168.0.100:8080

Both links are not accessible even from local computer (jenkins host itself). Same time commands ping 192.168.0.100 and ping myjenkinshost.local work just fine.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...