9

I'm trying to install Jenkins on my web server, which is an Ubuntu 13.10 server running on an Amazon EC2 instance. I've restarted Jenkins using

sudo /etc/init.d/jenkins restart

When I check my processes with

ps aux | grep jenkins

I can see multiple items running with the following descriptions:

jenkins  22356  0.0  0.0  20268   400 ?        S    10:10   0:00 /usr/bin/daemon --name=jenkins --inherit --env=JENKINS_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid -- /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/run/jenkins/war --httpPort=8080 --ajp13Port=-1 --httpListenAddress=127.0.0.1 --ajp13ListenAddress=127.0.0.1 --preferredClassLoader=java.net.URLClassLoader
jenkins  22358  5.9  5.7 1618372 97376 ?       Sl   10:10   0:17 /usr/bin/java -jar /usr/share/jenkins/jenkins.war --webroot=/var/run/jenkins/war --httpPort=8080 --ajp13Port=-1 --httpListenAddress=127.0.0.1 --ajp13ListenAddress=127.0.0.1 --preferredClassLoader=java.net.URLClassLoader

The server doesn't want to allow me to access this installation, so if I visit

x.x.x.x:8080

I just get a "Oops! Google Chrome could not connect" page, not even a HTTP status 404 / 500.

I tried checking /var/log/jenkins/jenkins.log, but it doesn't indicate any problems. Here's the log output after restarting:

Running from: /usr/share/jenkins/jenkins.war
Dec 02, 2013 10:10:07 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Jenkins home directory: /var/lib/jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Dec 02, 2013 10:10:13 AM winstone.Logger logInternal
INFO: HTTP Listener started: port=8080
Dec 02, 2013 10:10:13 AM winstone.Logger logInternal
INFO: Winstone Servlet Engine v0.9.10 running: controlPort=disabled
Dec 02, 2013 10:10:14 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Dec 02, 2013 10:10:14 AM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Dec 02, 2013 10:10:14 AM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Dec 02, 2013 10:10:14 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Dec 02, 2013 10:10:14 AM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Dec 02, 2013 10:10:22 AM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Dec 02, 2013 10:10:23 AM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Dec 02, 2013 10:10:23 AM hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 43315
Dec 02, 2013 10:10:23 AM hudson.WebAppMain$2 run
INFO: Jenkins is fully up and running

I was thinking I could be having a problem with EC2 security groups blocking the port, but my security group assigned to that server has got 8080 port opened for HTTP inbound.

Another check I tried was to SSH into the server, and use Lynx to see if Jenkins is actually serving content. I visited http://localhost:8080 and it was showing the Jenkins page as expected.

Any ideas?

Josef van Niekerk
  • 501
  • 4
  • 8
  • 15

1 Answers1

7

EDIT 2

If running Jenkins on an Amazon EC2 instance, try setting HTTP_HOST to 0.0.0.0. You may not be able to bind the public interface IP directly.


EDIT 1

Check /etc/default/jenkins instead if you installed directly from the .deb package.


It appears Jenkins is listening on localhost (--httpListenAddress=127.0.0.1). In this configuration, Jenkins is not listening for connections from the network interface.

To resolve for Ubuntu, check the contents of /etc/init/jenkins.conf and append --httpListenAddress=x.x.x.x to JENKINS_ARGS (where x.x.x.x is the server's external IP address).

plasmid87
  • 1,888
  • 15
  • 17