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.
Installation
wget -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
gao@gao-VirtualBox:~$ sudo apt-get install jenkins
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会安装下列额外的软件包:
ca-certificates-java daemon default-jre-headless icedtea-6-jre-cacao
icedtea-6-jre-jamvm java-common openjdk-6-jre-headless openjdk-6-jre-lib
tzdata-java
建议安装的软件包:
default-jre equivs sun-java6-fonts ttf-dejavu-extra fonts-ipafont-gothic
fonts-ipafont-mincho ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts
ttf-bengali-fonts
下列【新】软件包将被安装:
ca-certificates-java daemon default-jre-headless icedtea-6-jre-cacao
icedtea-6-jre-jamvm java-common jenkins openjdk-6-jre-headless
openjdk-6-jre-lib tzdata-java
升级了 0 个软件包,新安装了 10 个软件包,要卸载 0 个软件包,有 52 个软件包未被升级。
需要下载 105 MB 的软件包。
解压缩后会消耗掉 132 MB 的额外空间。
您希望继续执行吗?[Y/n]y
Upgrade
Once 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?
- Jenkins will be launched as a daemon up on start. See /etc/init.d/jenkins for more details.
- 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). |
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
- This configuration will setup Apache2 to proxy port 80 to 8080 so that you can keep Jenkins on 8080.
- sudo aptitude install apache2
- sudo a2enmod proxy
- sudo a2enmod proxy_http
do not do this next command if you already have virtual hosting setup that depends on the default site. See my comment below - danapsimer |
- sudo a2dissite default
- Create a file called jenkins.conf in /etc/apache2/sites-available
<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>
- sudo a2ensite jenkins
- sudo apache2ctl restart
Setting up an Nginx Proxy for port 80 -> 8080
This 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
-
Install Nginx.
sudo aptitude -y install nginx
-
Remove default configuration.
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 'ci.yourcompany.com' with your domain name.
Note: Sometimes your permissions (umask, etc) might be setup such that this won't work. Create the file somewhere else then copy it into place if you run into that problem.sudo cat > jenkins upstream app_server { server 127.0.0.1:8080 fail_timeout=0; } server { listen 80; listen [::]:80 default ipv6only=on; server_name ci.yourcompany.com; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { proxy_pass http://app_server; break; } } } ^D # Hit CTRL + D to finish writing the file
-
Link your configuration from sites-available to sites-enabled:
sudo ln -s /etc/nginx/sites-available/jenkins /etc/nginx/sites-enabled/
-
Restart Nginx
sudo service nginx restart
Where to go from here?
- You might want to make Jenkins visible through Apache, to make it available on port 80 (for example, http://myserver/jenkins/ instead of http://myserver:8080/). See this blog for more details
原文网址:https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu
相关推荐
面是我在Ubuntu6.06 LTS 下源码编译安装samba主要安装过程,本人第一次用Ubuntu,刚装上去时候,没有gcc编译环境。郁闷了半天。找出这一过程发了不少的时间。可能还有些不妥,不过我经过这样的安装达到了向windows共享...
### 安装Anaconda在Ubuntu上的详细步骤及关键知识点 #### 一、Anaconda简介 Anaconda是一款非常受欢迎的数据科学平台,它集成了Python或R语言环境中的许多库和工具,便于用户进行数据处理、科学计算、机器学习等...
### 安装STLinux在Ubuntu上的关键步骤与挑战 #### 概览 本文将深入探讨在Ubuntu上安装STLinux的全过程,重点解析由于包管理系统的差异而带来的挑战及其解决方案。对于那些希望在Ubuntu环境中利用STLinux强大功能的...
If you want to get up and running with Jenkins, see Installing Jenkins for procedures on how to install Jenkins on your supported platform of choice. If you are a typical Jenkins user (of any skill ...
OpenERP Installing Ubuntu9.04
Installing Jenkins Chapter 3. The New Jenkins Chapter 4. Configuring Jenkins Chapter 5. Distributed Builds Chapter 6. Installing Sonarqube And Artifactory Chapter 7. Continuous Integration Using ...
本篇将基于提供的文档摘要,深入解析安装Oracle RAC on AIX的关键步骤与注意事项,为读者提供一份详尽的操作指南。 ### 安装准备阶段 #### 1. 下载并解压安装介质 首先,需要从Oracle官方网站的edelivery服务下载...
Microsoft Windows 2000 Scripting Guide - Installing Software on a Remote Computer
https://jenkins.io/zh/doc/book/installing/ docker run \ -u root \ --rm \ -d \ -p 18080:8080 \ -p 50000:50000 \ -v jenkins-data:/var/jenkins_home \ -v /var/run/docker.sock:/var/run/docker.sock \...
Jenkins Fundamentals teaches you everything you need to know about installing, setting up, configuring, and integrating a Jenkins server with your project to speed up the product development life ...
2. Your First Steps with Jenkins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Introduction 9 Preparing Your Environment 9 Installing Java 10 Installing...
下载 Jenkins 到 Linux 服务器,下载地址:https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions#InstallingJenkinsonRedHatdistributions-ImportantNoteonCentOSJava。...
Installing Your Driver on Windows Millennium INF File Guide
Installing Ubuntu—Getting started 11 Finishing Installation 16 2 The Ubuntu Desktop 19 Understanding the Ubuntu desktop 19 Unity 19 The Launcher 21 The Dash 21 Workspaces 24 Managing windows 24 Unity...
根据提供的文档信息,本文将详细解析安装 Oracle RAC (Real Application Clusters) 在 AIX 操作系统上的步骤、注意事项及关键技术点。 ### 安装前准备 #### 下载安装介质与补丁集 ... - 示例文件包括:`B24442-01_1...
Installing Ubuntu 14.04 & ROS & TurtleBot 06-29-2016 个人小结,关于Ubuntu和ROS的安装。
在IT领域,将一款设备刷入不同的操作系统或定制ROM是一种常见的技术操作,它允许用户根据个人喜好和需求自定义手机的界面与功能。本篇内容将深入解析如何在魅族MX2上安装MIUI系统,这是一项对于Android发烧友而言极...
quantum espresso 视频可以认真学习 进行入门,非常不错的材料 给大家进行分享,值得拥有
Installing and configuring Ubuntu to ensure secure installations Virtual Ubuntu and LDAP configuration Full network and web services management What you’ll learn Administer, install, and configure ...
The Ubuntu Server Guide contains information on how to install and configure various server applications on your Ubuntu system to fit your ...installing Ubuntu, refer to the Ubuntu Installation Guide.