3

We have just installed Jenkins on our server (Debian 7 wheezy). It works on local network, but not on extern network. We search but we don't find any workaround for this problem.

We can ping our server but when we go on the address for jenkins it doesn't work.

4
  • Did you check your firewall settings?
    – Ulf Gitschthaler
    Sep 3, 2013 at 15:14
  • Is Tomcat running on port 80 or is it fronted by Apache? Sep 3, 2013 at 22:02
  • I think jenkins have his own container? No?
    – fische
    Sep 4, 2013 at 23:43
  • It depends how you installed it. Sep 5, 2013 at 0:32

2 Answers 2

4

Probably because of the reasons below:

1) Your web server config

For apache: allow from all

For tomcat:

<Host name="localhost" appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

should be

<Host name="www.example.com" appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

2) Your firewall settings (open port for external connection)

3) Jenkins Config

Firstly, for Debien, modify /etc/default/jenkins, add a line HTTP_HOST=external address (e.g. HTTP_HOST=www.example.com)

Then, add --httpListenAddress=$HTTP_HOST to your JENKINS_ARGS (JENKINS_ARGS="--webroot=/var/cache/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --httpListenAddress=$HTTP_HOST")

Finally, restart your jenkins

11
  • We have a redmine with apache already install and it works good. And with the iptables -L command the result is: Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination So normaly all port are open. No?
    – fische
    Sep 3, 2013 at 15:53
  • Try disable your firewall by: # /etc/init.d/iptables save # /etc/init.d/iptables stop Is your redmine accessible by external network? Is your jenkins and redmine are deployed the same web server? By default, Jenkins has its own standalone web server running on port 8080. Sep 4, 2013 at 1:34
  • Yes the redmine is always accessible by the external network. Redmine and Jenkins are not on the same server (ie Apache and tomcat). I really don't understand. Are there anything to change in the jenkin's configurationn ?
    – fische
    Sep 4, 2013 at 15:25
  • If I change the port of jenkins to 80 (ie the port of redmine) and i stop the apache. Jenkins doen't work too.
    – fische
    Sep 4, 2013 at 15:49
  • How about the jenkins config? under/etc/default/jenkins JENKINS_ARGS="--webroot=/var/run/jenkins/war --httpPort=$HTTP_PORT --ajp13Port=$AJP_PORT --httpListenAddress=$HTTP_HOST" $HTTP_HOST should not be localhost or 127.0.0.1 Sep 5, 2013 at 1:10
0

a) Open a Bash shell (Git Bash on Windows will do fine) on your home computer (not the Jenkins computer).

b) Perform a PORT FORWARD through a SECURE SSH TUNNEL to "map" port 8080 on the Jenkins computer to port 8080 on your home computer. The command to do this in the Git Bash shell is:

ssh -L 127.0.0.1:8080:localhost:8080 [email protected] -i "C:\PathToFolderContainingMySecretKey"

Here xx.yyy.zzz.ab is your public internet address (e.g., 62.187.151.9). Note that the path after -i is the path on your computer where you stored the private key which matches the public key you used on the Jenkins computer.

c) And now, on your home computer can connect like this: http://localhost:8080

d) The first time you configure Jenkins you'll need the initial admin password. Here's how to get it. In the Git Bash shell on the home computer (remember, you have already connected via SSH to the Jenkins computer):

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy and paste it into your browser, and away you go!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .