Linux安装tomcat
官网下载,Tomcat压缩包。
# tar -zxvf/share/ecs/apache-tomcat-8.5.5.tar.gz -C /opt/
start stop restart
# /opt/apache-tomcat-8.5.5/bin/startup.sh
Using CATALINA_BASE: /opt/apache-tomcat-8.5.5
Using CATALINA_HOME: /opt/apache-tomcat-8.5.5
Using CATALINA_TMPDIR:/opt/apache-tomcat-8.5.5/temp
Using JRE_HOME: /opt/jdk1.8.0_101
Using CLASSPATH: /opt/apache-tomcat-8.5.5/bin/bootstrap.jar:/opt/apache-tomcat-8.5.5/bin/tomcat-juli.jar
Tomcat started.
#tail -f logs/catalina.out
# wget http://localhost:8080
--2016-09-24 22:13:08-- http://localhost:8080/
正在解析主机 localhost (localhost)... 127.0.0.1
正在连接 localhost (localhost)|127.0.0.1|:8080... 已连接。
已发出 HTTP 请求,正在等待回应...200
长度: 未指定 [text/html]
正在保存至: “index.html.1”
[ <=> ] 11,228 --.-K/s 用时 0s
2016-09-24 22:13:08 (73.1 MB/s) -“index.html.1” 已保存 [11228]
#vi /etc/rc.d/rc.local
1.能过apt-get方式安装Tomcat
#sudo apt-get install tomcat6
2.进入安装上当下的\bin目录。
执行./startup.sh 或 Tomcat6 start
本地访问:localhost:8080
3.启动Tomcat服务
#sudo /etc/init.d/tomcat6 start
4.停止Tomcat服务
#sudo /etc/init.d/tomcat6 stop