CentOS安装Tomcat和Jenkins

DevOps 2020年05月17日

本篇笔记记录了CentOS7下yum安装Java和Tomcat,jenkins.war文件安装Jenkins的过程

虚拟机IP:192.168.75.238

安装Java

yum install java-1.8.0-openjdk

安装结果

[root@localhost ~]# java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

安装Tomcat

yum install tomcat

安装结果

[root@localhost ~]# tomcat version
Server version: Apache Tomcat/7.0.76
Server built:   Mar 17 2020 23:48:55 UTC
Server number:  7.0.76.0
OS Name:        Linux
OS Version:     3.10.0-1127.8.2.el7.x86_64
Architecture:   amd64
JVM Version:    1.8.0_252-b09
JVM Vendor:     Oracle Corporation
[root@localhost ~]# 

安装Jenkins

下载jenkins

wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war

停止tomcat

systemctl stop tomcat

移动到tomcat的webapps目录下

mv jenkins.war /usr/share/tomcat/webapps/

启动tomcat

systemctl start tomcat

浏览器访问jenkins:http://192.168.75.238:8080/jenkins

根据红框的路径找到Unlock Jenkins的密码

vim /usr/share/tomcat/.jenkins/secrets/initialAdminPassword


浏览器中输入密码,“继续”

叉掉插件安装界面,后续按需安装

点击“开始使用Jenkins”

Jenkins安装完毕!