centos7.8 部署tomcat+ant+jenkin+jmeter(mysql5.7)

先将相关安装包通过xftp/winscp等工具上传至服务器

[root@localhost /]# cd usr/
[root@localhost usr]# ls
apache-ant-1.9.15-bin.zip    bin    include      lib64    sbin   tmp
apache-jmeter-5.2.1.zip      etc    jenkins.war  libexec  share
apache-tomcat-9.0.41.tar.gz  games  lib          local    src

[root@localhost /]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.237.128  netmask 255.255.255.0  broadcast 192.168.237.255
        inet6 fe80::707a:645a:9e21:b1dc  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::21b3:a748:759a:4018  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:83:50:30  txqueuelen 1000  (Ethernet)
        RX packets 99  bytes 13759 (13.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 148  bytes 14081 (13.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 48  bytes 4080 (3.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 48  bytes 4080 (3.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:b8:ab:1b  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

#2、查看Java版本 
[root@localhost /]# java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

#3、解压Tomcat
[root@localhost usr]# tar -zxv -f apache-tomcat-9.0.41.tar.gz 

#4、等待解压完成创建文件夹
[root@localhost usr]# mkdir tomcat
[root@localhost usr]# ls
apache-ant-1.9.15-bin.zip    bin      jenkins.war  local  tmp
apache-jmeter-5.2.1.zip      etc      lib          sbin   tomcat
apache-tomcat-9.0.41         games    lib64        share
apache-tomcat-9.0.41.tar.gz  include  libexec      src
[root@localhost usr]# mv apache-tomcat-9.0.41 ./tomcat/

#5、启动Tomcat
[root@localhost usr]# cd tomcat/apache-tomcat-9.0.41/bin/
[root@localhost bin]# ls
bootstrap.jar                 configtest.sh     shutdown.sh
catalina.bat                  daemon.sh         startup.bat
catalina.sh                   digest.bat        startup.sh
catalina-tasks.xml            digest.sh         tomcat-juli.jar
ciphers.bat                   makebase.bat      tomcat-native.tar.gz
ciphers.sh                    makebase.sh       tool-wrapper.bat
commons-daemon.jar            setclasspath.bat  tool-wrapper.sh
commons-daemon-native.tar.gz  setclasspath.sh   version.bat
configtest.bat                shutdown.bat      version.sh
[root@localhost bin]# ./startup.sh 
Using CATALINA_BASE:   /usr/tomcat/apache-tomcat-9.0.41
Using CATALINA_HOME:   /usr/tomcat/apache-tomcat-9.0.41
Using CATALINA_TMPDIR: /usr/tomcat/apache-tomcat-9.0.41/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/tomcat/apache-tomcat-9.0.41/bin/bootstrap.jar:/usr/tomcat/apache-tomcat-9.0.41/bin/tomcat-juli.jar
Using CATALINA_OPTS:   
Tomcat started.

这时候浏览器一般无法访问,http://ip:8080

#6、安装iptables-services、开启相关端口
[root@localhost sysconfig]# yum install iptables-services
[root@localhost apache-ant-1.9.15]# vi /etc/sysconfig/iptables

//添加端口
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8899 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 20 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 6379 -j ACCEPT
#再次启动tomcat,浏览器可正常访问

#7、解压ant
[root@localhost usr]# mkdir ./ant
[root@localhost usr]# unzip apache-ant-1.9.15-bin.zip 

#8、修改系统环境变量:
[root@localhost usr]# vi /etc/profile;在文件的最后加上如下两行代码:

    #set Ant enviroment
    export ANT_HOME=/usr/ant/apache-ant-1.9.15
	export PATH=$PATH:$ANT_HOME/bin

#9、查看ant版本(验证安装)
[root@localhost ant]# ant -version
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64/lib/tools.jar
Apache Ant(TM) version 1.9.15 compiled on May 10 2020

#10、jmeter 解压即可

mysql的安装(因为没有安装包就图省事yum安装了)

#11、检查MariaDB

[root@localhost usr]# rpm -qa|grep mariadb
mariadb-libs-5.5.65-1.el7.x86_64
#也可能是这样
mariadb-server-5.5.60-1.el7_5.x86_64
mariadb-5.5.60-1.el7_5.x86_64
mariadb-libs-5.5.60-1.el7_5.x86_64

#12、删除mariadb

#如果不存在(上面检查结果返回空)则跳过步骤

[root@localhost usr]# rpm -e --nodeps mariadb-libs
[root@localhost usr]# rpm -qa|grep mariadb
#另一种情况
[root@localhost usr]# rpm -e --nodeps mariadb-server
[root@localhost usr]# rpm -e --nodeps mariadb
[root@localhost usr]# rpm -e --nodeps mariadb-libs

#其实yum方式安装是可以不用删除mariadb的,安装MySQL会覆盖掉之前已存在的mariadb

#13、检查MySQL

[root@localhost usr]# rpm -qa|grep mysql

#删除MySQL
	#如果不存在(上面检查结果返回空)则跳过步骤

[root@localhost usr]# rpm -e --nodeps xxx

后续安装可参考这篇博客
https://www.jianshu.com/p/19291fb17b99
离线安装
https://www.jianshu.com/p/7744856185b3?from=singlemessage
https://www.cnblogs.com/flying607/p/6060164.html

Java的安装
在centos 新建下新建 /usr/java

[root@localhost usr]# mkdir /usr/java
#将JDK安装包 jdk-8u131-linux-x64.tar.gz 上传到 /usr/java 下安装:
[root@localhost usr]# tar -zxvf jdk-8u131-linux-x64.tar.gz
#rpm -ivh jdk-8u131-linux-x64.tar.gz

#设置环境变量
#打开文件

[root@localhost usr]# vi /etc/profile

#在末尾添加

export JAVA_HOME=/usr/java/jdk1.8.0_131
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

#使环境变量生效

[root@localhost usr]# source /etc/profile

#添加软链接

[root@localhost usr]# ln -s /usr/java/jdk1.8.0_131/bin/java /usr/bin/java

#检查
java -version

相关下载连接
tomcat-9.0.41
jdk8_131
ant_1.9
mysql5.7

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值