*There are two installation methods commonly used by jenkins:
**
1. Use rpm package installation method (detailed)
**
* Download the rpm package to the local, jenkins download: http://pkg.jenkins-ci.org/redhat/
1. First check if the java virtual machine is installed, if not, install it
java -version//如果没有,则安装
2. Use the rpm package installation command under linux:
sudo rpm -ih jenkins-2.150-1.1.noarch.rpm
3. Configure in the jenkins configuration file
需要“vi /etc/init.d/jenkins”,把java路径加上,如下:
4. Set the port number and user name in the Jenkins file
vi /etc/sysconfig/jenkins
5. Execute the start command
sudo service jenkins start
1) Successful installation
2) If the above error is reported, it is because the java environment is not configured, and perform step 3
6. Enter "http://IP:8090" in the local browser to log in to Jenkins, the first time you log in to Jenkins, you will be asked to unlock
7. Open the path in the red mark, take out the password, fill in the above picture, and click "continue"
[root@YTX_18_93 ~]# cd /var/lib/jenkins/secrets:
vim /var/lib/jenkins/secrets/initialAdminPassword
8. After the input is complete, you will be prompted to install a custom plug-in or a recommended plug-in, here I choose the recommended plug-in:
9. After the plug-in installation is complete, enter the following information to set up an administrator user
At this point, jenkins has been installed.
10. Jenkins default installation directory
(1)/usr/lib/jenkins/:jenkins安装目录,WAR包会放在这里。
( 2 ) /etc/sysconfig/jenkins:jenkins配置文件,“端口”,“JENKINS_HOME”等都可以在这里配置。
(3)/var/lib/jenkins/:默认的JENKINS_HOME。
(4)/var/log/jenkins/jenkins.log:Jenkins日志文件。
two. Use the jenkins.war package installation method
(1) Download the war package jenkins.war directly from https://jenkins.io/download
1.1、可以把war包直接部署到servlet容器中,如tomcat。
1.2、可以使用命令直接运行war包,java -jar jenkins.war
(two)
1.下载jenkins.war 包。
Jenkins官方地址:http://Jenkins-ci.org/ (最新war包的下载地址:
http://mirrors.jenkins-ci.org/war/latest/jenkins.war)
2.下载一个tomcat容器在webapps中放入jenkins.war,不要解压。
3. 在cd /opt/soft/tomcat/webapps/ 中执行 java -jar jenkins.war
5. 查看日志是否有异常,访问http://ip:8080即可看到jenkins界面,jenkins安装成功。
.
.
.
Afterword: After I found out that my white shoes were dirty, my partner would brush me clean, so I decided to buy only white shoes from now on.