码迷,mamicode.com
首页 > 其他好文 > 详细

Tomcat安装

时间:2018-04-04 16:46:31      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:netstat   eof   2.7   ror   star   chmod   lib   chm   oracl   

安装jdk

cd /usr/local/src/
wget http://211.162.74.234:9011/download.oracle.com/c3pr90ntc0td/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-x64.tar.gz
tar zxvf jdk-8u111-linux-x64.tar.gz
mv jdk1.8.0_111 /usr/local/

配置

cat > /etc/profile.d/java.sh <<EOF
AVA_HOME=/usr/local/jdk1.8.0_111
JAVA_BINE=/usr/local/jdk1.8.0_111/bin
JRE_HOME=/usr/local/jdk1.8.0_111/jre
PATH=$PATH:/usr/local/jdk1.8.0_111/bin:/usr/local/jdk1.8.0_111/jre/bin
CLASSPATH=/usr/local/jdk1.8.0_111/jre/lib:/usr/local/jdk1.8.0_111/lib:/usr/local/jdk1.8.0_111/jre/lib/charsets.jar
EOF

查看并卸载系统jdk

yum list|grep jdk
yum remove java-1.6.0-openjdk.x86_64 java-1.7.0-openjdk.x86_64

使jdk配置生效并查看版本是否正确

. /etc/profile.d/java.sh
java -version

下载安装tomcat

wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.6/bin/apache-tomcat-8.5.6.tar.gz
tar zxvf apache-tomcat-8.5.6.tar.gz
mv apache-tomcat-8.5.6 /usr/local/tomcat
cp -v /usr/local/tomcat/bin/catalina.sh /etc/init.d/tomcat
chmod 755 /etc/init.d/tomcat

修改tomcat配置

cat >> /etc/init.d/tomcat <<EOF
# chkconfig: 2345 63 37
. /etc/init.d/functions
JAVA_HOME=/usr/local/jdk1.8.0_111
CATALINA_HOME=/usr/local/tomcat
EOF

添加服务开机自动启动

chkconfig --add tomcat
chkconfig tomcat on

启动&检查

/etc/init.d/tomcat start
netstat -lnp
curl -I localhost:8080

Tomcat安装

标签:netstat   eof   2.7   ror   star   chmod   lib   chm   oracl   

原文地址:https://www.cnblogs.com/linuxde/p/8717969.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!