6

I have installed Jenkins in Windows server 2012 64-bit machine and want to make it available in internal network.

I have added --httpListenAddress to 0.0.0.0 and restarted Jenkins and tried to access it with http://hostname:8080 but no page shows up(though It showing Jenkins icon in URL bar). However http://localhost:8080 works fine.

enter image description here

Further I checked the firewall inbound rule for the Jenkins but seems it has no issues. enter image description here

I tried to catch the listening ports with "netstat -aon | find /i "8080" and found <host ip address>:8080 FIN_WAIT_2 which sign towards that the request is stuck(May be I am wrong).

I am clueless what exactly is blocking to use hostname with jenkins. Please share your solution if you already fixed this issue.

3 Answers3

3

You might try adding a Windows Firewall rule. Go to Windows Firewall, Advanced Configuration, Inbound Rules rule and create an Allow rule for the specific version of java.exe you have installed.

This worked for us with the drawback that every time you upgrade Java, you must also modify the firewall rule. This is because Java creates a new subfolder for every version. We've tried using %JAVA_HOME% in firewall rules but it doesn't seem to work. We were on Windows Server 2012R2 at the time.

Similar answer here: https://stackoverflow.com/a/17479566/7752

Larry Silverman
  • 1,043
  • 1
  • 11
  • 30
1

On the server open a new command prompt and type ipconfig

You should get a list of ips. Open a browser and type each up followed by 8080 for e.g. http://202.123.2.1:8080

If Jenkins opens up, from another computer ping the ip and see if you can get a ping reply ping 202.123.2.1

If you get a ping reply, you can access jenkins from any pc on the network by typing in the ip and port number.

Now to get to the hostname,you need to edit your host file

c:\Windows\System32\Drivers\etc\hosts

Type in the ip followed by the hostname 202.123.2.1 jenkins

If you can't get through, you need to open port 8080. See https://www.vultr.com/docs/how-to-open-a-port-in-windows-firewall-on-windows-server-2012

Yasirmx
  • 417
  • 3
  • 9
  • I tried with each IP and result is same. Though trying each IP does not make sense but the hostname. However I see Jenkins icon in address bar while using hostname in URL i.e. `http://hostname:8080` It seems that request is going to Jenkins but no results are showing up, page is blank. I have also tested that port 8080 is open in localhost with telnet hostname 8080 –  Jul 07 '17 at 08:33
  • Have a look at these:http://www.mikaelhallne.se/2015/09/16/blank-page-when-loading-jenkins/ https://stackoverflow.com/questions/35276283/jenkins-gives-me-blank-page – Yasirmx Jul 08 '17 at 20:02
-2

You cannot access from outside the machine because Jenkins Service does not have credentials to use that machine, only from localhost is accessible.

This is how to enter the credentials in Jenkins service.

  1. In the Windows search bar, type services then enter.
  2. Then scroll down to Jenkins and double-click on it.
  3. In Jenkins Properties, select the tab "Log On".
  4. Select Check box "This account"
  5. Update your username and password.

Voila! Now Jenkins web can connect to the Jenkins machine via Jenkins service.

Afsanefda
  • 3,069
  • 6
  • 36
  • 76
Philbo
  • 5
  • 2