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.

fische
  • 31

2 Answers2

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

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 YourAdminName@xx.yyy.zzz.ab -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!

Gary
  • 1