Installing Jenkins on Ubuntu

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

Key
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|http://jenkins-ci.org/debian/]. Older but stable LTS versions are in [this apt repository|http://pkg.jenkins-ci.org/debian-stable/].

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 [https://issues.jenkins-ci.org/browse/JENKINS-743|https://issues.jenkins-ci.org/browse/JENKINS-743].

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.


{note}
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).
{note}

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

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

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

{noformat}
juju set jenkins password=mypassword
{noformat}

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

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*.
{code}
{code}
cd /etc/nginx/sites-available
sudo rm default ../sites-enabled/default
{code}
* *Create new configuration for Jenkins*. This example uses {{cat}}, but you can use your favorite text editor. Make sure to replace 'ci.yourcompany.com' with your domain name.