Install Jenkins under Linux (centos6.5)

Source: Internet
Author: User

the predecessor of Jenkins was The Hudson is an extensible, continuous integration engine.

In layman's terms, Jenkins is a plug-in that enables automated deployment

For me, it is also applied on the system deployment.

No more nonsense, just go to our installation steps

1. Installation of Jdk,maven Environment construction

Because of the actual application scenario of Jenkins, we need to install these basic environments first.

JDK installation is relatively simple and do not repeat, MAVEN environment borrowed from the other heroes of the OSC blog content,

Tried the installation successfully.

MAVEN official website Download installation package: http://maven.apache.org/download.cgi

Download the version on demand, where the author chooses the version 3.1.1.

1. Upload the apache-maven-3.1.1-bin.tar.gz to the server,

Extract:

TAR-ZVXF apache-maven-3.1.1-bin.tar.gz

move to the/usr/local :

MV Apache-maven-3.1.1/usr/local

Configuring Environment variables

Vi/etc/profile

Include in the file

Export Maven_home=/usr/local/apache-maven-3.1.1export path= $PATH: $MAVEN _home/bin

Recompile files

Source/etc/profile

Verify that MAVEN is installed successfully

MVN--version

The console displays as follows:

Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 23:22:22+0800)

Maven Home:/usr/local/apache-maven-3.1.1

Java version:1.7.0_25, Vendor:oracle Corporation

Java Home:/usr/java/jdk1.7.0_25/jre

Default LOCALE:ZH_CN, Platform Encoding:utf-8

OS name: "Linux", Version: "2.6.32-358.6.2.el6.x86_64", Arch: "AMD64", Family: "Unix"

Indicates that the installation was successful.

2. Install Jenkins

Wget-o/etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo rpm--import/http Pkg.jenkins-ci.org/redhat/jenkins-ci.org.keyyum Install Jenkins

After the execution of a single command, Jenkins is finished with the installation, which is very simple.

Then you need to configure the ports under Jenkins to avoid collisions.

Vi/etc/sysconfig/jenkins

Enter the file, this is Jenkins's system configuration file,

Find 2 modified port numbers:

jenkins_port= "8080"

Jenkins_ajp_port= "8009"

The default is this, we can arbitrarily modify the port number we need to avoid conflict (the Tomcat default port is the same)

Here the author modifies:

jenkins_port= "8888"

Jenkins_ajp_port= "8889"

Then we can try to start the Jenkins service.

Service Jenkins Start

If prompted: Starting Jenkins [OK]

This means that the Jenkins service starts successfully, and you can access Jenkins directly via the HTTP://IP: port number.

However, in general, the error will be:

Starting Jenkins bash:/usr/bin/java: No file or directory [failed]

If this error does not need to panic, the reason for this mistake is because of your JDK configuration error,

Execute command:

Java-version

Java Version "1.7.0_25"

Java (TM) SE Runtime Environment (build 1.7.0_25-b15)

Java HotSpot (TM) 64-bit Server VM (build 23.25-b01, Mixed mode)

We can see that the JDK version is 1.7.0_25, copy the name

Vi/etc/init.d/jenkins

Find this piece of code

Candidates= "/etc/alternatives/java/usr/lib/jvm/java-1.6.0/bin/java/usr/lib/jvm/jre-1.6.0/bin/java/usr/lib/jvm/ java-1.7.0/bin/java/usr/lib/jvm/jre-1.7.0/bin/java/usr/lib/jvm/java-1.8.0/bin/java/usr/lib/jvm/jre-1.8.0/bin/ Java/usr/bin/java

We'll find that there's no file directory called 1.7.0_25.

We add the following code to the

/usr/java/jdk1.7.0_25/bin/java

The effect is as follows:

Candidates= "/etc/alternatives/java/usr/lib/jvm/java-1.6.0/bin/java/usr/lib/jvm/jre-1.6.0/bin/java/usr/lib/jvm/ java-1.7.0/bin/java/usr/lib/jvm/jre-1.7.0/bin/java/usr/lib/jvm/java-1.8.0/bin/java/usr/lib/jvm/jre-1.8.0/bin/ Java/usr/bin/java/usr/java/jdk1.7.0_25/bin/java "

Save exit. To re-execute the start command:

Service Jenkins Start

Did it succeed?

Stop command:

Service Jenkins Stop

Restart command:

Service Jenkins Restart

After successful startup, we can access it through the HTTP://IP: port number.

Here, the Jenkins installation is OK. Oh

Install Jenkins under Linux (centos6.5)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.