Detailed tutorial for installing Jenkins in linux environment

*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

Insert picture description here
3. Configure in the jenkins configuration file

	需要“vi /etc/init.d/jenkins”,把java路径加上,如下:

Insert picture description here
4. Set the port number and user name in the Jenkins file

	vi /etc/sysconfig/jenkins

Insert picture description here
5. Execute the start command

	sudo service jenkins start

Insert picture description here
1) Successful installation
Insert picture description here

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
Insert picture description here7. 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

Insert picture description here

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:

1Insert picture description here

9. After the plug-in installation is complete, enter the following information to set up an administrator user
Insert picture description here

Insert picture description hereInsert picture description here
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.

Guess you like

Origin blog.csdn.net/weixin_43945983/article/details/106134397