Installing Jenkins on Ubuntu

compared with
Current by Michael Vogel
on Mar 26, 2014 18:35.

This line was removed.
This word was removed. This word was added.
This line was added.

Changes (7)

View Page History
Recent versions are available in [an apt repository|]. Older but stable LTS versions are in [this apt repository|].

You need to have a JDK and JRE installed. openjdk-6-jre and openjdk-6-jdk installed. openjdk-7-jre and openjdk-7-jdk are suggested. As of 2011-08 gcj is known to be problematic - see [|].

Please make sure to back up any current Hudson or Jenkins files you may have.
* The '{{jenkins}}' user is created to run this service.
* Log file will be placed in {{/var/log/jenkins/jenkins.log}}. Check this file if you are troubleshooting Jenkins.
* {{/etc/default/jenkins}} will capture configuration parameters for the launch like e.g JENKINS_HOME
* By default, Jenkins listen on port 8080. Access this port with your browser to start configuration.

If your /etc/init.d/jenkins file fails to start jenkins, on line 108 you may change su \-l <username> \-c <command> with sudo \-u <username> <command>. This fixed init.d script for me (icarito, July 2013).

h1. Deploying on Ubuntu in a cloud (EC2, HP Cloud, OpenStack)

The Ubuntu Jenkins maintainer also maintains the [Juju charm deployment/management script|] for deployment in clouds. It's designed to make it easy to deploy a master with multiple slaves:
juju deploy jenkins
juju deploy -n 5 jenkins-slave
juju add-relation jenkins jenkins-slave

The default password for the 'admin' account will be auto-generated. You can set it using:

juju set jenkins password=mypassword

Always change it this way - this account is used by the charm to manage slave configuration. Then feel free to expose your jenkins master:
juju expose jenkins

h1. Setting up an Apache Proxy for port 80 \-> 8080

* {{sudo a2enmod proxy}}
* {{sudo a2enmod proxy_http}}
* {{sudo a2enmod vhost_alias}}

{note}do not do this next command if you already have virtual hosting setup that depends on the default site. See my comment below - danapsimer{note}
* {{sudo a2dissite default}}

* *Install Nginx*.
cd /etc/nginx/sites-available
sudo rm default ../sites-enabled/default
* *Create new configuration for Jenkins*. This example uses {{cat}}, but you can use your favorite text editor. Make sure to replace '' with your domain name.