tomcat安装

环境:centos7.5

ip地址:192.168.0.91


1、安装 JDK
Tomcat 的安装依赖 JDK,在安装 Tomcat 之前需要先安装 Java JDK。输入命令 java -version,如果显示 JDK 版本,证明已经安装了 JDK

jdk安装请参照:https://www.cnblogs.com/effortsing/p/10012211.html
 


2、安装 Tomcat

2.1、解压安装包

rz apache-tomcat-8.5.31.tar.gz

tar xf apache-tomcat-8.5.31.tar.gz 

mv apache-tomcat-8.5.31 /usr/local/tomcat


2.2、启动romcat


 /usr/local/tomcat/bin/catalina.sh start
 

2.3、查看端口
 

[root@bogon tomcat]# netstat -tnlp            
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 192.168.0.91:5601       0.0.0.0:*               LISTEN      15053/node          
tcp        0      0 192.168.0.91:9100       0.0.0.0:*               LISTEN      14232/grunt         
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      943/sshd            
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1173/master         
tcp6       0      0 127.0.0.1:9600          :::*                    LISTEN      28715/java          
tcp6       0      0 127.0.0.1:8005          :::*                    LISTEN      30058/java          
tcp6       0      0 :::8009                 :::*                    LISTEN      30058/java          
tcp6       0      0 :::8080                 :::*                    LISTEN      30058/java          
tcp6       0      0 192.168.0.91:9200       :::*                    LISTEN      14105/java          
tcp6       0      0 192.168.0.91:9300       :::*                    LISTEN      14105/java          
tcp6       0      0 :::22                   :::*                    LISTEN      943/sshd            
tcp6       0      0 ::1:25                  :::*                    LISTEN      1173/master       



2.4、查看进程 

ps -ef | grep tomcat



2.5、访问tomcat首页

http://192.168.0.91:8080



2.6、增加tomcat网页

mkdir -p /usr/local/tomcat/webapps/webdir/

cat >>/usr/local/tomcat/webapps/webdir/index.html<<EOF
<h1>welcome to use tomcat</h1>
EOF



2.7、浏览器访问


http://192.168.0.91:8080/webdir/index.html

welcome to use tomcat



2.8、停止tomcat

直接kil -9 30058









 
 

 

posted @ 2018-11-24 21:22  effortsing  阅读(187)  评论(0编辑  收藏  举报