這一講是把你的Jenkins地址暴露給局域網內的其他人訪問
目前,你的Jenkins只能在你的機子上訪問,地址是http://localhost:8080,或者http://127.0.0.1:8080,但是如果你的本機局域網IP地址是192.168.38.1,那么你輸入http://192.168.1.1:8080,網頁會出現以下錯誤
訪問不了IP.jpeg
這是因為你的Mac上Jenkins監聽的IP不對,下面改一個配置就可以
1、首先需要停掉Jenkins
brew services stop jenkins
2、打開下面的路徑
/usr/local/Cellar/jenkins/
這個路徑下打開
homebrew.mxcl.jenkins.pist文件的地址.jpg
打開homebrew.mxcl.jenkins.pist這個文件,里面有一句話是這樣的
--httpListenAddress=127.0.0.1
把它編輯成
--httpListenAddress=0.0.0.0
以允許所有的IP地址
3、那么接下來,啟動Jenkins
brew services start jenkins
4、瀏覽器里輸入你的IP加端口
http://192.168.1.1:8080
就可以進入到Jenkins里,局域網里的其他用戶也可以訪問哈