Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 978
Alexey Strakh Avatar asked Oct 26 '14 05:10

Alexey Strakh


People also ask

How do I change my IP to Jenkins public IP?

In your jenkins Dashboard go to Manage Jenkins > Configure System. Under Jenkins Location set the Jenkins URL to the new IP address of your server computer. Save changes.

What is the default URL for Jenkins?

By default, the Jenkins URL points to localhost. If you have a domain name setup for your machine, set this to the domain name else overwrite localhost with IP of machine.

How do I access Jenkins from another machine?

I found that, after upgrading the local Java instance, Jenkins was no longer accessible over the domain. The fix was to update the path to the new java.exe, in the Programs and Services tab, in the Properties of the Jenkins rule, in Windows Firewall Advanced settings.


2 Answers

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> 
like image 122
DreamTeam Mobile Avatar answered Sep 20 '22 21:09

DreamTeam Mobile


The correct location of the file to edit is /usr/local/opt/jenkins/homebrew.mxcl.jenkins.plist

Found the answer here

like image 30
jinjorge Avatar answered Sep 21 '22 21:09

jinjorge