Jenkins not accessible with http://<hostname>:8080 in Windows server 2012 - jenkins

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.
Further I checked the firewall inbound rule for the Jenkins but seems it has no issues.
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.

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

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

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.
In the Windows search bar, type services then enter.
Then scroll down to Jenkins and double-click on it.
In Jenkins Properties, select the tab "Log On".
Select Check box "This account"
Update your username and password.
Voila! Now Jenkins web can connect to the Jenkins machine via Jenkins service.

Related

Unable to access localhost Jenkins from the another computer in the same network

Unable to access localhost Jenkins from another computer in the same network. These are the steps I did
1) I pinged the ip address of the computer from another computer and it is successful
2) I change the Jenkins URL in the config to - http://[IP of the machine:8080]
3) Turned off the firewall.
However I am not able to access this url from the same computer or another computer - http://[IP of the machine:8080]
Any time would be appreciated. Followed all the steps, not sure if i need to use a service like xamp or mamp
i also did ifconfig and this is what i got. My jenkins port is running on :8080 and i dont know what url to add to my jenkins so i can access it from other network within the same computer
Also what other steps i need to do, do i need to open the port from somwhere?
For Instance, your IP of Jenkins master is 192.169.x.x.
Open the Port 8080 via firewall and then change the URL of jenkins from "Manage Jenkins >>Config Sys >> Jenkins Location>" to "http://192.169.x.x:8080"
Now you can access it from other machine on same network domain.Just have to hit the url http://192.169.x.x:8080
You can now create different users with different privileges for the same.
You can find it under Manage Jenkins >> Manage Users >> Create Users.

Jenkins : Unable to access jenkins in local machine

I'm trying to create a Test automation Pipeline to run my selenium scripts, I installed Jenkins in windows Remote Server 2012. Used following cmd($ java -jar jenkins.war) to start jenkins. It is working fine in Remote server with url:http://localhost:8080/
But when I'm trying to access it outside Remote server(my local machine) it is not working. am getting error message "This site can’t be reached"
My local laptop and Remote server is under the same proxy org network.
Can someone help how to resolve this issue , so that other folks can access it and run jobs when required from their laptops
Thanks in advance
Access Windows Firewall.
Add an inbound rule to allow port 8080 and
try accessing the url from any machine in the network.
you could allow/restrict access to all IPs, range of IPs or allow all. But to nullify the issue and confirm if its an issue with whitelisting IPs, I'd first allow access from all IPs with the wildcard *
for Debugging if its a port whitelisting issue, you could also telnet from the machine that you are trying to access this machine -
try
telnet remote machines IP Port
note: do not use a colon for port input just use a space

Possible to Change Jenkins URL? : http://localhost:8080

Possible to Change Jenkins URL? : http://localhost:8080
Currently I have jenkins setup on a virtual machine.
Is it possible to setup Jenkins on a URL which is more is accessible for other users?
For example I dont want other users to access test results by connecting to the Virtual machine instead I want them to access a URL from their own device in turn enabling them to login and see test results via jenkins.
thanks for you help
Let's say IP of your virtual machine is 192.168.x.x.
Open the Port 8080 via firewall and then change the URL of jenkins from
"Manage Jenkins >>Config Sys >> Jenkins Location>" to "http://192.168.x.x:8080"
Now you can access it from other machine on same network domain.Just have to hit the url http://192.168.x.x:8080
You can now create different users with different privileges for the same.
You can find it under Manage Jenkins >> Manage Users >> Create Users.
It is related to networking. The machines should be on the same network, so they can talk to each other (unless you have public IP).
The ONLY rule to give access is, that machines can talk to each other (of course, in their language, 0's & 1's).
I suggest following things to do to share the URL:
Ask the users to connect to the same network that your machine is in.
Verify whether they are able to PING your machine IP (get it from ipconfig command for windows - router assigns IP for your machine, that starts with 192.168 or 10.10). command example: ping 10.10.1.10
If any issues in Ping, it might be Windows Firewall or Anti-virus which might be blocking, so allow the IPs in your firewall so they can access your machine.
Then ask them to access Jenkins using the following URL http://[IP of your machine:8080]
We want the Jenkins web interface to be accessible from anywhere (not
just on the local machine), so we’re going to open up the config file:
sudo nano /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.plist
Find this line:
<string>--httpListenAddress=127.0.0.1</string>
And change it to:
<string>--httpListenAddress=0.0.0.0</string>
RF : Installing Jenkins on macOS

Issues with Jenkins 1.67 URL set up

I am trying to set a new Jenkins instance (version 1.67) on to a Windows Server 2012 r2.
I am trying to configure a custom URL instead of using
localhost:8080
etc..
I have set Jenkins URL as
NewServer.domainname.com
But I cannot access it via that url, I get presented with a message "Remote Web Access is turned off" it only allows me to connect when I follow the URL with the port number;
NewServer.domainname.com:8080
I am sure that Remote web access is completely different from what my goal is.
By default, Jenkins launches its own built-in webserver, listening on port 8080.
Changing the URL in the Jenkins configuration does not change the port that the running webserver listens on, but rather the URL that is shown within the UI, or in emails sent to users etc.
In order to access Jenkins at just NewServer.domainname.com (i.e. running on port 80), you would first have to disable Windows Remote Web Access, which is currently occupying port 80.
You would then need to stop Jenkins and start it again with the flag --httpPort=80; these options are documented on the Jenkins wiki.
If Jenkins was started as a Windows Service, you can edit the jenkins.xml file as shown in these answers.
Just wanted to say, after setting Jenkins.xml to run on port 80, and then via the Jenkins web interface using
'install as service'
I found that this process seemed to create a new jenkins.xml along with the default httpPort which is stored within the Jenkins.war.
I get around this I installed as a service, ensured that the service was not set to start on start up. Rebooted the machine
On start up I re-edited the jenkins.xml httpPort value back to 80. Started the service and now running very happy!

How to access / share Jenkins from another computer?

I installed jenkins (localhost:8080) on RHEL and I am able to build code successfully
Now, I want to setup master / slave agent.
My laptop will act as 'Master Jenkins' and my colleague's will be 'Slave'
However, my colleague could not connect to 'Master Jenkins' and we both are on SAME LAN and able to ping each other
I tried the following but nothing worked
(a) Changed --httpListenAddress=0.0.0.0
(b) Changed --httpListenAddress=<my laptop ip>
(c) Changed --httpListenAddress=<my colleague's laptop ip>
and my colleague tried 'telnet <my laptop ip> 8080' from his laptop and did not work
Please help me to resolve this issue and I am new to Jenkins
Jenkins should host it's own service, so that is probably not the problem. Is your firewall open on port 8080?
Issue has been resolved by adding the port no '8080' in firewall
Goto 'Computer --> More Applications (or) Control Center --> Firewall --> Other Ports --> Add'
For all Mac Users. None of the above worked for me I installed Jenkins using HomeBrew.
go to
~/Library/LaunchAgents/homebrew.mxcl.jenkins.plist
and Change the httpListenAddress value from 127.0.0.1 to 0.0.0.0.
Since this homebrew.mxcl.jenkins.plist file in placed in LaunchAgents you need to restart your machine to make this effective.
Open the POrt 8080 via firewall and then change the URL of jenkins from "Manage Jenkins>Config Sys>Jenkins Location>" to "http://yourIP:8080" and then access it from other machine on same network domain.
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. You may also use the "All programs that meet the specified conditions" setting, but I do not know the impact that choice would have on the security of the server.

Resources