王大拿
知道的越多,不知道的也就越多! 只要学不死,就往死里学!!!

安装jdk

查找openjdk安装包

[root@leanote ~]# yum list|grep openjdk
java-1.8.0-openjdk.x86_64                              1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-accessibility.x86_64                1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-demo.x86_64                         1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-devel.x86_64                        1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-headless.x86_64                     1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-headless-slowdebug.x86_64           1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-javadoc.noarch                      1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-javadoc-zip.noarch                  1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-slowdebug.x86_64                    1:1.8.0.302.b08-0.el8_4                           appstream    
java-1.8.0-openjdk-src.x86_64                          1:1.8.0.302.b08-0.el8_4                           appstream    
java-11-openjdk.x86_64                                 1:11.0.12.0.7-0.el8_4                             appstream    
java-11-openjdk-demo.x86_64                            1:11.0.12.0.7-0.el8_4                             appstream    
java-11-openjdk-devel.x86_64                           1:11.0.12.0.7-0.el8_4                             appstream    
java-11-openjdk-headless.x86_64                        1:11.0.12.0.7-0.el8_4                             appstream    
java-11-openjdk-javadoc.x86_64                         1:11.0.12.0.7-0.el8_4                             appstream    
java-11-openjdk-javadoc-zip.x86_64                     1:11.0.12.0.7-0.el8_4                             appstream    
java-11-openjdk-jmods.x86_64                           1:11.0.12.0.7-0.el8_4                             appstream    
java-11-openjdk-src.x86_64                             1:11.0.12.0.7-0.el8_4                             appstream    
java-11-openjdk-static-libs.x86_64  

安装java-1.8.0-openjdk.x86_64

[root@leanote ~]# yum install java-1.8.0-openjdk.x86_64
上次元数据过期检查:0:12:10 前,执行于 2021年09月16日 星期四 14时19分30秒。
依赖关系解决。
===================================================================================================================================================================================================================================================================
 软件包                                                                 架构                                              版本                                                                          仓库                                                  大小
===================================================================================================================================================================================================================================================================
安装:
 java-1.8.0-openjdk                                                     x86_64                                            1:1.8.0.302.b08-0.el8_4                                                       appstream                                            336 k
安装依赖关系:
 copy-jdk-configs                                                       noarch                                            3.7-4.el8                                                                     appstream                                             27 k
 java-1.8.0-openjdk-headless                                            x86_64                                            1:1.8.0.302.b08-0.el8_4                                                       appstream                                             34 M
 javapackages-filesystem                                                noarch                                            5.3.0-1.module_el8.0.0+11+5b8c10bd                                            appstream                                             30 k
 lksctp-tools                                                           x86_64                                            1.0.18-3.el8                                                                  baseos                                               100 k
 ttmkfdir                                                               x86_64                                            3.0.9-54.el8                                                                  appstream                                             62 k
 tzdata-java                                                            noarch                                            2021a-1.el8                                                                   appstream                                            192 k
 xorg-x11-fonts-Type1                                                   noarch                                            7.5-19.el8                                                                    appstream                                            522 k
启用模块流:
 javapackages-runtime                                                                                                     201801                                                                                                                                  

事务概要
===================================================================================================================================================================================================================================================================
安装  8 软件包

总下载:35 M
安装大小:120 M
确定吗?[y/N]: y
下载软件包:
(1/8): copy-jdk-configs-3.7-4.el8.noarch.rpm                                                                                                                                                                                       258 kB/s |  27 kB     00:00    
(2/8): java-1.8.0-openjdk-1.8.0.302.b08-0.el8_4.x86_64.rpm                                                                                                                                                                         1.8 MB/s | 336 kB     00:00    
(3/8): javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch.rpm                                                                                                                                                       379 kB/s |  30 kB     00:00    
(4/8): ttmkfdir-3.0.9-54.el8.x86_64.rpm                                                                                                                                                                                            553 kB/s |  62 kB     00:00    
(5/8): tzdata-java-2021a-1.el8.noarch.rpm                                                                                                                                                                                          952 kB/s | 192 kB     00:00    
(6/8): lksctp-tools-1.0.18-3.el8.x86_64.rpm                                                                                                                                                                                        611 kB/s | 100 kB     00:00    
(7/8): xorg-x11-fonts-Type1-7.5-19.el8.noarch.rpm                                                                                                                                                                                  1.5 MB/s | 522 kB     00:00    
(8/8): java-1.8.0-openjdk-headless-1.8.0.302.b08-0.el8_4.x86_64.rpm                                                                                                                                                                 23 MB/s |  34 MB     00:01    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                                                                                                                24 MB/s |  35 MB     00:01     
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
  运行脚本: copy-jdk-configs-3.7-4.el8.noarch                                                                                                                                                                                                                  1/1 
  运行脚本: java-1.8.0-openjdk-headless-1:1.8.0.302.b08-0.el8_4.x86_64                                                                                                                                                                                         1/1 
  准备中  :                                                                                                                                                                                                                                                    1/1 
  安装    : lksctp-tools-1.0.18-3.el8.x86_64                                                                                                                                                                                                                   1/8 
  运行脚本: lksctp-tools-1.0.18-3.el8.x86_64                                                                                                                                                                                                                   1/8 
  安装    : tzdata-java-2021a-1.el8.noarch                                                                                                                                                                                                                     2/8 
  安装    : ttmkfdir-3.0.9-54.el8.x86_64                                                                                                                                                                                                                       3/8 
  安装    : xorg-x11-fonts-Type1-7.5-19.el8.noarch                                                                                                                                                                                                             4/8 
  运行脚本: xorg-x11-fonts-Type1-7.5-19.el8.noarch                                                                                                                                                                                                             4/8 
  安装    : javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch                                                                                                                                                                                  5/8 
  安装    : copy-jdk-configs-3.7-4.el8.noarch                                                                                                                                                                                                                  6/8 
  安装    : java-1.8.0-openjdk-headless-1:1.8.0.302.b08-0.el8_4.x86_64                                                                                                                                                                                         7/8 
  运行脚本: java-1.8.0-openjdk-headless-1:1.8.0.302.b08-0.el8_4.x86_64                                                                                                                                                                                         7/8 
  安装    : java-1.8.0-openjdk-1:1.8.0.302.b08-0.el8_4.x86_64                                                                                                                                                                                                  8/8 
  运行脚本: java-1.8.0-openjdk-1:1.8.0.302.b08-0.el8_4.x86_64                                                                                                                                                                                                  8/8 
  运行脚本: copy-jdk-configs-3.7-4.el8.noarch                                                                                                                                                                                                                  8/8 
  运行脚本: java-1.8.0-openjdk-1:1.8.0.302.b08-0.el8_4.x86_64                                                                                                                                                                                                  8/8 
  验证    : copy-jdk-configs-3.7-4.el8.noarch                                                                                                                                                                                                                  1/8 
  验证    : java-1.8.0-openjdk-1:1.8.0.302.b08-0.el8_4.x86_64                                                                                                                                                                                                  2/8 
  验证    : java-1.8.0-openjdk-headless-1:1.8.0.302.b08-0.el8_4.x86_64                                                                                                                                                                                         3/8 
  验证    : javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch                                                                                                                                                                                  4/8 
  验证    : ttmkfdir-3.0.9-54.el8.x86_64                                                                                                                                                                                                                       5/8 
  验证    : tzdata-java-2021a-1.el8.noarch                                                                                                                                                                                                                     6/8 
  验证    : xorg-x11-fonts-Type1-7.5-19.el8.noarch                                                                                                                                                                                                             7/8 
  验证    : lksctp-tools-1.0.18-3.el8.x86_64                                                                                                                                                                                                                   8/8 
Installed products updated.

已安装:
  copy-jdk-configs-3.7-4.el8.noarch    java-1.8.0-openjdk-1:1.8.0.302.b08-0.el8_4.x86_64    java-1.8.0-openjdk-headless-1:1.8.0.302.b08-0.el8_4.x86_64    javapackages-filesystem-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch    lksctp-tools-1.0.18-3.el8.x86_64   
  ttmkfdir-3.0.9-54.el8.x86_64         tzdata-java-2021a-1.el8.noarch                       xorg-x11-fonts-Type1-7.5-19.el8.noarch                       

完毕!

[root@leanote ~]# java -version
openjdk version "1.8.0_302"
OpenJDK Runtime Environment (build 1.8.0_302-b08)
OpenJDK 64-Bit Server VM (build 25.302-b08, mixed mode)
[root@leanote ~]# 

安装apache-tomcat

下载安装包

wget https://dlcdn.apache.org/tomcat/tomcat-8/v8.5.71/bin/apache-tomcat-8.5.71.tar.gz

解压 apache-tomcat-8.5.71.tar.gz

tar -xzvf apache-tomcat-8.5.71.tar.gz

移动目录到/opt

mv apache-tomcat-8.5.71 /opt/

配置Tomcat server.xml

server.xml 可以配置端口,编码以及配置项目等等,在此配置端口,把默认的8080,修改成8088

vim /opt/apache-tomcat-8.5.71/conf/server.xml
image

启动服务

[root@leanote ~]# /opt/apache-tomcat-8.5.71/bin/startup.sh 
Using CATALINA_BASE:   /opt/apache-tomcat-8.5.71
Using CATALINA_HOME:   /opt/apache-tomcat-8.5.71
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.5.71/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/apache-tomcat-8.5.71/bin/bootstrap.jar:/opt/apache-tomcat-8.5.71/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.

配置防火墙,开放80端口

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

浏览器访问

http://192.168.64.132:8088/
image

部署jenkins

上传jenkins.war包

重启服务

[root@leanote bin]# ./shutdown.sh 
Using CATALINA_BASE:   /opt/apache-tomcat-8.5.71
Using CATALINA_HOME:   /opt/apache-tomcat-8.5.71
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.5.71/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/apache-tomcat-8.5.71/bin/bootstrap.jar:/opt/apache-tomcat-8.5.71/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
[root@leanote bin]# ./s
setclasspath.sh  shutdown.sh      startup.sh       
[root@leanote bin]# ./startup.sh 
Using CATALINA_BASE:   /opt/apache-tomcat-8.5.71
Using CATALINA_HOME:   /opt/apache-tomcat-8.5.71
Using CATALINA_TMPDIR: /opt/apache-tomcat-8.5.71/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/apache-tomcat-8.5.71/bin/bootstrap.jar:/opt/apache-tomcat-8.5.71/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
Tomcat started.

访问jenkins

http://192.168.64.132:8088/jenkins/

image

修改默项目

在server.xml文件<host></host>标签中间,添加如下内容:
<Context path="访问路径" docBase="项目名称" reloadable="true"/>
posted on 2021-10-11 11:17  DevOps_SRE  阅读(134)  评论(0编辑  收藏  举报