Posted on 2017-01-06 21:14
朱杰兵 阅读(90)
评论(0) 编辑 收藏
Tomcat的安装
解压缩
# mkdir /usr/local/tomcat
# cd /usr/local/tomcat
# tar -zxvf /software/apache-tomcat-7.0.54.tar.gz
生成链接以便版本升级
# ln -s apache-tomcat-7.0.54 server
启动Tomcat
# cd /usr/local/tomcat/server/bin
# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/server
Using CATALINA_HOME: /usr/local/tomcat/server
Using CATALINA_TEMDIR: /usr/local/tomcat/server/temp
Using JRE_HOME: /usr/java/default
Using CLASS_PATH: /usr/local/tomcat/server/bin/bootstrap.jar:/usr/local/tomcat/server/bin/tomcat-juli.jar
Tomcat started.
测试Tomcat:
打开防火墙,使外部能访问
# /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
# service iptables save
# service iptables restart
或直接修改文件/etc/sysconfig/iptables.
# vi /etc/sysconfig/iptables
-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
# service iptables restart
在浏览器输入: http://192.168.16.133:8080
如在本机可以输入: http://localhost:8080
出现tomcat的页面表示安装成功.
停止Tomcat
# ./shutdown.sh