Centos 7 安装Tomcat7


JDK安装

wget http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz?AuthParam=1520415799_a40e8dd75b55b27fedcd8a15270ad067 -O jdk
mkdir -p /usr/local/java
cp -r xx /usr/local/java
vi /etc/profile.d/jdk.sh
加入:
JAVA_HOME=/usr/local/java/jdk
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME PATH
运行jdk.sh重加载
. /etc/profile.d/jdk.sh
java -version

Apache-Tomcat安装

1. wget -c http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.85/bin/apache-tomcat-7.0.85.tar.gz -O tomcat7.tar.gz
tar -zxvf tomcat8.tar.gz
vi /etc/profile.d/tomcat.sh
----------------------
CATALINA_BASE=/usr/local/java/tomcat7
PATH=$CATALINA_BASE/bin:$PATH
export PATH CATALINA_BASE
----------------------------------------
. /etc/profile.d/tomcat.sh
cd /usr/local/java/tomcat/bin
./startup.sh
如果没有执行权限 就 sudo chmod u+x *.sh
然后访问 ip:8080

声明:ITMO|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - Centos 7 安装Tomcat7


欢迎访问我的博客 -- IT猫