Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

There are three ways to install Jenkins on a Linux server by downloading the Jenkins installation file:

    1. Yum install
    1. Download war+ Tomcat deployment and installation
    1. The RPM installation Jenkins. RPM

Here we introduce the RPM installation mode

First, download the RPM file and use winScp to transfer it to the opt/ directory.

RPM - the ivh Jenkins - 2.32.3-1.1 noarch. RPM

Install the war directory at /usr/lib/jenkins

Configure the Jenkins port number

Vi /etc/sysconfig/jenkins: JENKINS_PORT="8686" and jenkins_home

Starting Jenkins bash: /usr/bin/java: The Java variable is not found;

Add a Java environment variable to /etc/init.d/ Jenkins:

# Search usable Java as /usr/bin/java might not point to minimal version required by Jenkins. # see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html candidates=" The/etc/alternatives/Java/usr/lib/JVM/Java - 1.8.0 comes with/bin/Java/usr/lib/JVM/jre - 1.8.0 comes with/bin/Java/usr/lib/JVM/Java - 1.7.0 / bin/Java The/usr/lib/JVM/jre - 1.7.0 / bin/Java/usr/bin/Java/usr/local/jdk1.7 / bin/Java (note Modify the install JDK path for yourself here, "For candidate in $candidates do [-x "$JENKINS_JAVA_CMD"] && break JENKINS_JAVA_CMD="$candidate" doneCopy the code

Then restart the service: service Jenkins restart

Access requires a login password, install the generated password file:

vi /var/lib/jenkins/secrets/initialAdminPassword

Error: No such Cloudbees – Folder…

The plugin failed to install, so download the Cloudbees - Folder. phi file and place it under Jenkins /plugins/. In the restart load, or failed; Page plug-in installation skipped, manually install in the management plug-in: <http://updates.jenkins-ci.org/download/plugins>Copy the code

Still need to continue to find a solution!

In networking state, install Jenkins, run Tomcat, start service, visit:http://ipaddr:port/jenkins, enter the initial password, installing a plug-in

Email Extension Plugin; Collect test results and notify relevant personnel by email; You are advised to restart the tomcat service. Check how many Tomcat services are enabled on Linux first to avoid port occupation. After configuring email information, you are advised to use non-QQ email and enable the SMTP function. If the VM configuration is too low and too many services are running, the VM runs slowly. You are advised to add memory for the service to be started, and the Java VM runs memory OPTSCopy the code