詹金斯无法通过局域网访问

Sno*_*man 5 networking jenkins

我已经通过 brew 安装了 Jenkins,它现在在端口 8080 上运行Machine A(使用 IP 10.0.6.6):10.0.6.6:8080在打开时给我 Jenkins Machine A

在机器 B 上,如果我输入10.0.6.6:8080,页面不会加载。我已经确保端口8080确实打开了,并且我已经手动打开了它:

sudo ipfw add 8080 allow tcp from any to any dst-port 8080
Run Code Online (Sandbox Code Playgroud)

我有Apache上运行并监听端口80Machine A,我可以从机器B与访问就好了10.0.6.6:80

运行sudo lsof -i:8080以查看在端口 8080 上侦听的内容:

java      67405            root  168u  IPv6 0x8559ae29226e47f7      0t0  TCP localhost:http-alt (LISTEN)
java      67405            root  276u  IPv6 0x8559ae2927c6b397      0t0  TCP localhost:http-alt->localhost:52067 (ESTABLISHED)
Run Code Online (Sandbox Code Playgroud)

Machine A在 Mac OSX 10.8.5 上。知道是什么原因造成的吗?

我可以提供的任何其他详细信息:

我安装了Jenkins:

brew install jenkins
Run Code Online (Sandbox Code Playgroud)

我开始詹金斯:

sudo launchctl load ~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
Run Code Online (Sandbox Code Playgroud)

小智 14

homebrew 中的默认 homebrew.mxcl.jenkins.plist 具有以下内容:

<string>--httpListenAddress=127.0.0.1</string>
Run Code Online (Sandbox Code Playgroud)

这使它只在本地主机上侦听。要使其侦听所有接口,您可以将其替换为:

<string>--httpListenAddress=0.0.0.0</string>
Run Code Online (Sandbox Code Playgroud)

然后我想你需要launchctl unload/load来重启。当然,如果您愿意,您也可以输入更具体的收听地址。