使用tomcat容器安装jenkins
1、部署tomcat,tomcat下载https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat,此时下载9.0版本的,10版本部署有bug,无法实现。
//安装jdk
[root@server ~]# yum -y install java-11-openjdk
解压tomcat,并部署安装
[root@server ~]# tar -xzf apache-tomcat-9.0.67.tar.gz -C /usr/local/
[root@server local]# ln -s apache-tomcat-9.0.67/ tomcat
启动tomcat,测试能否访问tomcat首页
[root@server local]# cd tomcat/
[root@server tomcat]# bin/startup.sh
2、部署jenkins
下载jenkins到/usr/local/tomcat/webapps/目录下
去浏览器下载jenkins https://www.jenkins.io/zh/download/
下载下来后会自动解压
[root@localhost ~]# cd /usr/local/tomcat/webapps/
[root@localhost webapps]# ls
docs examples host-manager manager ROOT
[root@localhost webapps]# wget http://mirrors.jenkins.io/war-stable/2.346.3/jenkins.war
[root@localhost webapps]# ls
docs examples host-manager jenkins jenkins.war manager ROOT
启动服务
[root@localhost webapps]# cd /usr/local/tomcat
[root@localhost tomcat]# bin/catalina.sh stop
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME