#切换
sduo su
tomcat_dir="/usr/local/tomcat"
#创建tomcat文件夹
if [ ! -d "$tomcat_dir" ];
then
mkdir $tomcat_dir
fi
cd $tomcat_dir
#远程获取tomcat
if [ ! -d "apache-tomcat-7.0.79.tar.gz" ];
then
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.79/bin/apache-tomcat-7.0.79.tar.gz
fi
#解压
tar -xvf apache-tomcat-7.0.79.tar.gz
#改变端口 port 8080 to 80
sed -i 's/8080/80/' apache-tomcat-7.0.79/conf/server.xml
#赋予./权限
chmod u+x *.sh
#启动
cd $tomcat_dir/apache-tomcat-7.0.79/bin
./startup.sh
Shell脚本 centOS7中自动安装Tomcat7
最新推荐文章于 2023-11-20 14:43:43 发布