2018-02-01 16:34:02 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-05-07 14:14:30 +08:00
|
|
|
cat << EOF
|
|
|
|
|
2018-02-24 14:53:53 +08:00
|
|
|
###################################################################################
|
|
|
|
# 安装 Tomcat 脚本
|
2019-05-07 14:29:16 +08:00
|
|
|
# @system: 适用于所有 linux 发行版本。
|
|
|
|
# @author: Zhang Peng
|
2018-02-24 14:53:53 +08:00
|
|
|
###################################################################################
|
2018-02-01 16:34:02 +08:00
|
|
|
|
2019-05-07 14:14:30 +08:00
|
|
|
EOF
|
2018-02-01 16:34:02 +08:00
|
|
|
|
2018-02-24 14:53:53 +08:00
|
|
|
version=8.5.28
|
2019-05-07 14:14:30 +08:00
|
|
|
if [[ -n $1 ]]; then
|
|
|
|
version=$1
|
|
|
|
fi
|
|
|
|
|
|
|
|
root=/opt/tomcat
|
|
|
|
if [[ -n $2 ]]; then
|
|
|
|
root=$2
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo -e "\n>>>>>>>>> download tomcat"
|
2018-02-24 14:53:53 +08:00
|
|
|
mkdir -p ${root}
|
2018-09-30 17:24:58 +08:00
|
|
|
wget -O ${root}/apache-tomcat-${version}.tar.gz https://archive.apache.org/dist/tomcat/tomcat-8/v${version}/bin/apache-tomcat-${version}.tar.gz
|
2019-05-07 14:14:30 +08:00
|
|
|
|
|
|
|
echo -e "\n>>>>>>>>> install tomcat"
|
|
|
|
tar zxvf ${root}/apache-tomcat-${version}.tar.gz -C ${root}
|