5

I have installed Jenkins and opened port 8080 on Ubuntu 12.04 server but still can't access Jenkins remotely. Below is the procedures I took.

# Install Jenkins, enable UFW and open port 8080
sudo apt-get install jenkins
sudo ufw enable
sudo ufw allow 8080
sudo ufw reload

# Check the status
sudo ufw status
8080    ALLOW    Anywhere
8080    ALLOW    Anywhere (v6)

# Locally
curl -I localhost:8080
HTTP/1.1 200 OK
Server: Winstone Servlet Engine v0.9.10
...

# On an external machine
curl -I [ip]:8080
couldn't connect to host
ezraspectre
  • 151
  • 1
  • 1
  • 4

5 Answers5

7

I ran into this issue which was resolved by editing jenkins config file

sudo vim /etc/default/jenkins

edit HTTP_HOST, default 127.0.0.1 to

HTTP_HOST=0.0.0.0

Nuts
  • 71
  • 1
  • 3
0

Add JENKINS_ARGS

JENKINS_ARGS="--prefix=/jenkins --httpListenAddress=YOUR_IP --ajp13ListenAddress=YOUR_IP"

on Centos/Redhat, you can find on /etc/sysconfig/jenkins.

chocripple
  • 2,109
  • 14
  • 9
  • 1
    On Ubuntu it's `/etc/default/jenkins`. – mgorven Jul 18 '12 at 04:41
  • Tried internal and external ip addresses and still nothing. When I add the ip args I can no longer access jenkins locally. – ezraspectre Jul 18 '12 at 19:51
  • I will probably end up setting up projects on my desktop installation and exporting them to the server installation -- is this the usually process -- im new to jenkins? – ezraspectre Jul 18 '12 at 19:59
  • after you add the JENKINS_ARGS, are you able to see the --httpListenAddress on your process list (ps aux|grep jenkins) ? or if you can find jenkins.war, just running it manually (java -jar jenkins.war -httpListenAddress=YOUR_IP) – chocripple Jul 19 '12 at 05:50
  • @Rikih -- yup its in the output for `sudo ps aux | grep jenkins` -- but still cant access jenkins remotely – ezraspectre Jul 19 '12 at 19:11
  • netstat | grep JENKINS_PORT, if it's listen on IP:JENKINS_PORT, mean firewall on your server/network. flush the firewall for test. if it's working mean the firewall rule else check firewall on network – chocripple Jul 20 '12 at 04:17
0

I recently ran into this issue which was resolved by adding 8080 port access to the uft firewall.

sudo ufw allow 8080

Adam
  • 1
0

Check if apparmor is running on your Ubuntu , may be apparmor blocking it, if its running stop it.

0

What firewall are you using? If you are using iptables then run sudo iptables -L to see which ports are opened/blocked.