我在Mac OS X上使用自制软件设置了jenkins,它 可以通过主机正常工作,http://localhost:8080或者http://127.0.0.1:8080无法通过主机名/ ipaddress访问jenkins实例:
http://localhost:8080
http://127.0.0.1:8080
1. http://myjenkinshost.local:8080 2. http://192.168.0.100:8080
即使从本地计算机(詹金斯主机本身)也无法访问这两个链接。同时执行命令ping 192.168.0.100并ping myjenkinshost.local正常工作。
ping 192.168.0.100
ping myjenkinshost.local
事实证明,启动代理配置为仅侦听127.0.0.1(或localhost)。要修复该詹金斯经纪人的plist:
nano /Users/admin/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
并修改httpListenAddress为0.0.0.0而不是127.0.0.1
httpListenAddress
0.0.0.0
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>