|
On Debian-based distributions, such as Ubuntu, you can install Jenkins through apt-get. 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-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. Please make sure to back up any current Hudson or Jenkins files you may have. Installationwget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt-get update sudo apt-get install jenkins UpgradeOnce installed like this, you can update to the later version of Jenkins (when it comes out) by running the following commands: sudo apt-get update sudo apt-get install jenkins (aptitude or apt-get doesn't make any difference.) What does this package do?
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 Setting up an Apache Proxy for port 80 -> 8080
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName ci.company.com ServerAlias ci ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost on ProxyPass / http://localhost:8080/ nocanon AllowEncodedSlashes NoDecode </VirtualHost>
Setting up an Nginx Proxy for port 80 -> 8080This configuration will setup Nginx to proxy port 80 to 8080 so that you can keep Jenkins on 8080. Instructions originally found in a GitHub Gist from rdegges: https://gist.github.com/913102
Where to go from here?
|
Installing Jenkins on Ubuntu
Skip to end of metadata
Go to start of metadata
Comments (21)
Sep 15, 2009
japher - says:
The above instructions worked for me on Jaunty (9.04) Server, the daemon depende...The above instructions worked for me on Jaunty (9.04) Server, the daemon dependency was picked up correctly.
There's a bug in the 1.322 and 1.323 releases of Hudson though that stops the hudson service starting up correctly. See https://hudson.dev.java.net/issues/show_bug.cgi?id=4304 (need to edit /etc/init.d/hudson and apply a fix as mentioned in the comments of that bug report).
Sep 16, 2009
benjamin dorsett says:
On Jaunty (9.04) Server, the daemon dependency is picked up correctly. But Huds...On Jaunty (9.04) Server, the daemon dependency is picked up correctly.
But Hudson doesn't start. Changing hudson user's shell to /bin/bash instead of /bin/false in /etc/passwd seems to fix it.
Sep 18, 2009
Jose Salvador says:
My case: I work on a Debian Lenny dist (stable) I have updated the sources lis...My case:
I work on a Debian Lenny dist (stable)
I have updated the sources list following the instructions above and have applied the patch attached to the bug
Then, I have had to install the sun-java6-bin package to get working. In my experience the hudson does not start with the debian gnu java. I obtained an exception related to this message:
" Could not instantiate converter : com.thoughtworks.xstream.converters.extended.DurationConverter : null"
Of course, I have changed the symbolic link at /usr/bin/java by one which links directly to the java from sun.
Cheers.
Sep 24, 2009
Ben Standefer says:
This fix worked for me when installing Hudson on Debian Lenny: "After installing...This fix worked for me when installing Hudson on Debian Lenny: "After installing the hudson deb on Ubuntu server Jaunty 8.10 [Debian Lenny in my case], when I tried to run the init script /etc/init.d/hudson start, nothing would be printed and the server would not start. No log file was created under /var/log/hudson and no pid file was created under /var/run/hudson. I eventually discovered that if i set the hudson user's shell to /bin/bash instead of /bin/false in /etc/passwd everything works fine. Hope this saves someone else some trouble."
Also, this is a good resource: http://weblogs.java.net/blog/2008/06/11/debian-packages-hudson
Apr 06, 2010
Régis Desgroppes says:
Hi, Hudson 1.353 was not published in the apt repository. Is there something wro...Hi,
Hudson 1.353 was not published in the apt repository. Is there something wrong?
Régis
May 12, 2010
Mohamed Ragab says:
Hi, The latest version of Hudson as of the time of writing this comment is 1.35...Hi,
The latest version of Hudson as of the time of writing this comment is 1.357 but the latest Debian package published is 1.352 and the latest RPM package published is 1.353
Is this just lag, or is there a change in plans?
Kind Regards
Mohamed Ragab
May 18, 2010
Willem Verstraeten says:
Hi, It seems as if the URL of the apt-get repository changed to deb http://jen...Hi,
It seems as if the URL of the apt-get repository changed to
deb http://jenkins-ci.org/debian binary/
I did get an error on my Debian 5.0.4 machine, but on Ubuntu it seems to work. Got to investigate.
The error was
302 Found http://pkg.jenkins-ci.org/debian/binary/Packages
May 23, 2010
tcharl - says:
Hi, Sorry, I can't find where I could post an Issue on Your JIRA. Can you put ...Hi,
Sorry, I can't find where I could post an Issue on Your JIRA.
Can you put the Latest 1.359 rpm's version please, we're stuck with 1.353 and so with the "java.lang.Error: This page expects a form submission" when creating a new Job
Aug 28, 2010
Max V.K. says:
hi there. I've noticed the debian repository responds with response "302", which...hi there.
I've noticed the debian repository responds with response "302", which is redirect related.
apt does not support redirects as of now. Debian stabe apt does not.
I am currently forced to download the file manually, although it is found in the repository.
Can somebody please change the setup so that not a redirect is returned, but the file?
Thanks.
Nov 08, 2010
Stefan Seidel says:
Here's a workaround for lenny: you need: apache2, mod_proxy. Then create a file...Here's a workaround for lenny: you need: apache2, mod_proxy.
Then create a file /etc/apache2/sites-available/hudson-deb with this content:
<VirtualHost *:80> ServerName hudson-deb.local RewriteEngine On RewriteRule ^/debian/binary/(.+\.deb) http://download.jenkins-ci.org/debian/$1 [P] RewriteRule ^(.*)$ http://pkg.jenkins-ci.org$1 [P] <Proxy *> Order Deny,Allow Allow from all </Proxy> </VirtualHost>Edit /etc/hosts and add hudson-deb.local as the last term on the line containing 127.0.0.1 (separate it with a space).
Then enable the proxy and the site and restart the apache:
Then you just add the file /etc/apt/sources.list.d/hudson.list with the following content:
And off you go with:
Apr 12, 2011
Dana P'Simer says:
the "sudo a2dissite default" step should only be done if you do not want the def...the "sudo a2dissite default" step should only be done if you do not want the default site to stay in place. All the steps described should work without this step in a normal virtual hosted environment on a Debian/Ubuntu installation.
Jul 22, 2011
Steven Bromley says:
It should probably be more clear that installing Jenkins is going to replace any...It should probably be more clear that installing Jenkins is going to replace any current installations of Hudson you have on a box.
Oct 10, 2011
Barry Warsaw says:
Ubuntu 11.10 (Oneiric) has Jenkins 1.409.1 afaict. sudo apt-get install j...Ubuntu 11.10 (Oneiric) has Jenkins 1.409.1 afaict. sudo apt-get install jenkins jenkins-cli should get you the basics (do aptitude search jenkins for the full suite of packages). sudo service jenkins start should start the server by default on localhost:8080.
Nov 23, 2011
Ed Young says:
I have jenkins conflicting with tomcat because both run on port 8080. I've just...I have jenkins conflicting with tomcat because both run on port 8080.
I've just upgraded to 11.10 and installed tomcat7 (port 8080 default) and then jenkins as a standalone. Both done using synaptic.
jenkins fails with a port already in use exception, so I need to reconfigure it so it's on a different port. What's the best way to do this?
The section above entitled:
Setting up an Apache Proxy for port 80 -> 8080
If I follow that, it appears that jenkins will still be on port 8080, and that will conflict with tomcat.
I'm only starting to be familiar with how Ubuntu installs tomcat and jenkins. What's the best way to change the port of either tomcat or jenkins from 8080 so they don't conflict?
Nov 23, 2011
Ed Young says:
Where can I find the configuration file to change the port where jenkins runs? ...Where can I find the configuration file to change the port where jenkins runs?
the instructions above indicate that
/etc/default/jenkins will capture configuration parameters for the launch.
After installation using synaptic on 11.10, there is no /etc/default/jenkins file.
Apr 18, 2012
Benny Chew says:
Just installed using Aptitude (v1.460) on Ubuntu 11.10, the line in /etc/default...Just installed using Aptitude (v1.460) on Ubuntu 11.10, the line in /etc/default/jenkins to change would be the following:
Oct 02, 2012
Chin Fang says:
Why in the current Ubuntu package, 1.484, the group for the 'jenkins' user is se...Why in the current Ubuntu package, 1.484, the group for the 'jenkins' user is set to 'nogroup'? The group in the corresponding RPM is set to 'jenkins' however. Admitted this is not a fatal inconsistency, but an inconsistency nevertheless?
Oct 01, 2013
Anton Trapp says:
On debian squeeze one of the latest updates does something very ugly... - runnin...On debian squeeze one of the latest updates does something very ugly... - running system - aptitude update - now this:
Nov 15, 2013
Dmitry Sheiko says:
On dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors w...On dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/jenkins_1.539_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
On Ubuntu 12.04.3 LTS on any attempt to install jenkins
sudo apt-get install jenkins
sudo apt-get install -f jenkins
it ends up with the error:
...
dpkg: error processing /var/cache/apt/archives/jenkins_1.539_all.deb (--unpack):
trying to overwrite '/usr/share/jenkins/jenkins.war', which is also in package jenkins-common 1.424.6+dfsg-1ubuntu0.2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/jenkins_1.539_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
P.S. I tried to install some old version
apt-get install jenkins=1.424.6+dfsg-1ubuntu0.2
and it worked fine
Apr 08, 2014
Michael Kryzhanovsky says:
Installing under apache has some caveats. In my case I wanted Jenkins to respond...Installing under apache has some caveats. In my case I wanted Jenkins to respond to a subomain, e.g. ci.myhost.com. In this case the config should be as follows:
Note, that nocanon and NoDecode are important.
A simple tool comes with Jenkins to test your proxy configuration, so you can check if everything works correctly as follows:
curl -iL http://ci.myhost.com/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test
Mar 10
Allen McIntosh says:
Above didn't work for me unfortunately. Ubuntu 14.04, followed the instruc...Above didn't work for me unfortunately. Ubuntu 14.04, followed the instructions down to apt-get install. I changed the port number to 8888. ps shows that jenkins is running:
/usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8888 --ajp13Port=-1
but there is no response when I try to connect to port 8888. The log looks clean except for the "NO JSP support" message:
Running from: /usr/share/jenkins/jenkins.war
Mar 10, 2015 5:07:55 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Mar 10, 2015 5:07:55 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-winstone-2.8
Mar 10, 2015 5:07:57 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
Jenkins home directory: /var/lib/jenkins found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Mar 10, 2015 5:07:58 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started SelectChannelConnector@0.0.0.0:8888
Mar 10, 2015 5:07:58 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
...
When my browser tries to connect to port 8888, wireshark shows an HTTP GET being sent, and that is all.
Where do I go from here?
Add Comment