参考链接1:tomcat安装和部署jenkins_jenkins和tomcat-CSDN博客
参考链接2:--配置开机启动tomcat文件
参考链接3:面链接是有关tomcat安装后系统配置文件的问题,我这边把之前的tomcat删除后,启动新的时候一直会指定之前被删除的文件启动;配置环境变量文件

1、进入centos中 /usr/local 目录文件下
[root@localhost webapps]# cd /usr/local
2、使用通过wget命令下下载tomcat或者直接在官网下载centos版本的包后移动到centos中的local路径下
3、下载tomcat按照包后,解压安装包
4、修改tomcat安装包名称
5、通过addr ip 查看服务器的ip地址 在浏览器中输入ip:8080,即可访问tomcat

6、在打开的网页中点击Manager App

7、进入如下界面,这时需要复制虚线框中的文本内容

8、进入到/usr/local/tomcat/conf/tomcat-users.xml 文件中修改tomcat-users.xml配置文件
[root@localhost conf]# pwd
/usr/local/tomcat8.5.99/conf
[root@localhost conf]# vim tomcat-users.xml
9、在键盘中点击i进入编辑模式,将步骤7中复制的文本粘贴到最后面的</tomcat-users>前面,并需要将username:用户名和password:密码中的值都改为admin,方便记忆登陆,保存
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="123456" roles="admin-gui,manager-gui,manager-script"/>

10、进入/usr/local/tomcat8/webapps/host-manager/META-INF路径下修改context.xml文件,将allow的值改为"^.*$"
allow="^.*$" />

11、进入/usr/local/tomcat8/webapps/manager/META-INF路径下修改context.xml文件,将allow的值改为"^.*$",与步骤10一样。

12、这时就完成了tomcat的配置工作
13、下载jenkins包到 /usr/local/tomcat8/webapps 路径下;下载链接如下:


14、在浏览器中输入centos中ip:8080/jenkins,即可出现如下界面

15、通过cat命令查看弹窗提示的文件,找到密码输入到弹窗中
[root@localhost webapps]# cat /root/.jenkins/secrets/initialAdminPassword
73934a28ea0e45749551417e189404ee
16、点击第一个,推荐安装,

进入下载插件界面。
