Install Jenkins on CentOS
Install Jenkins on CentOS
1. Add the Jenkins source (repository ):
$ Sudo wget-O/etc/yum. repos. d/jenkins. repo http://jenkins-ci.org/redhat/jenkins.repo
$ Sudo rpm -- import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
2. Install/check JDK:
$ Java-version
[Root @ user-api1 ~] # Java-version
Java version "1.8.0 _ 40"
Java (TM) SE Runtime Environment (build1.8.0 _ 40-b26)
Java HotSpot (TM) 64-Bit Server VM (build25.40-b25, mixed mode)
3. Install Jenkins:
$ Sudo yum install jenkins
After the installation is complete, the following directories are available:
(3.1)/usr/lib/jenkins/: jenkins installation directory, where the WAR package is located.
[Root @ user-api1 ~] # Ls-rlt/usr/lib/jenkins/
Total 64964
-Rw-r -- 1 root 66519999 Apr 2107:50 jenkins. war
(3.2)/etc/sysconfig/jenkins: The jenkins configuration file, "Port", and "JENKINS_HOME" can all be configured here.
(3.3)/var/lib/jenkins/: Default JENKINS_HOME.
(3.4)/var/log/jenkins. log: Jenkins log file.
4. Start Jenkins
$ Sudo service jenkins start
The following error may occur: "StartingJenkins-bash:/usr/bin/java: No such file or directory ". Jenkins cannot be found and java cannot be found.
In this case, you need "vi/etc/init. d/jenkins" to add the java path (as shown below ):
5. log on to Jenkins
If no special port is configured, Use http: // <ipaddress>: 8080/to log on to Jenkins and perform related configuration (plug-in installation, permission configuration, View/Job creation, and so on ).