我通过brew install jenkins-lts
在macOS中安装了Jenkins。
macOS在Windows主机上作为VirtualBox VM实例运行。
在VirtualBox主机Windows上,我无法从浏览器通过http://localhost:8080
或http://10.0.2.15:8080
访问Jenkins。 (10.0.2.15
是我的访客VM macOS的IP地址)
我设置的内容
http://localhost:8080
0.0.0.0:8080
/ GUEST:10.0.2.15:8080
SSH
主机的相同端口转发设置:0.0.0.0:22
/ GUEST:10.0.2.15:22
,我可以成功连接到SSH
。答案 0 :(得分:0)
通过默认配置文件/usr/local/Cellar/jenkins-lts/2.x.x/homebrew.mxcl.jenkins-lts.plist
。 brew-installed
Jenkins的默认监听地址是127.0.0.1
而不是0.0.0.0
。这导致Jenkins的Web服务器仅侦听来自localhost的请求,而不是任何网络适配器。
步骤
vi /usr/local/Cellar/jenkins-lts/2.x.x/homebrew.mxcl.jenkins-lts.plist
<string>--httpListenAddress=127.0.0.1</string>
,然后更改为<string>--httpListenAddress=0.0.0.0</string>
brew services restart jenkins-lts
参考