Installing Jenkins on Ubuntu

Really for most experienced admins this and this should suffice . After install I changed the port Jenkins runs on. To change the port I altered the /etc/defaults/jenkins file changing the ‘HTTP_PORT’ value to 11939. Yeah that’s just an arbitrary port you could pick whichever you like. We run Nginx, so I’ll elaborate on how I made Jenkins available from anywhere. So in my case I run Jenkins on it’s own domain, hudson.blueleftistconstructor.com, and so the Nginx conf was really simple, here it is:

server {
    listen 46.4.29.134:80;
    server_name hudson.blueleftistconstructor.com;
    location / {
        proxy_pass http://127.0.0.1:11939;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

So that was all it took, reloaded Nginx and I was off. If you use Apache or some other proxy server you’re on your own in figuring out how to hook in Jenkins.

Now one thing to watch out for, if you make your Jenkins open to the ‘nets. It doesn’t have any security setup by default. You’ll want to use it’s built in security database to setup some users. This’ll save you from opening Jenkins one day and finding that someone came along and messed with your jobs.

Luckily this is pretty easy. Go to “manage jenkins > configure system”. Look for the “Access Control” section, then select “Jenkins’s own user database”.  In the “Authorization” section below select the “Matrix-based Security” option. Enter a new user, given the name you prefer. Add the user then select ALL the check boxes in the row besides it. For the ‘Anonymous’ user I suggest selecting just the ‘read’ permission in the “Overall” category. Now you’ll want to save. Then you’ll see on the front page a link with title “signup now”, click it and sign up using the username you just created.

Now you should be all good to go. You should sign in and start creating some jobs!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>