Centos6.10安装tomcat
1. 下载tomcat
2. 解压到相应的路径下
tar -xzvf apache-tomcat-8.5.34.tar.gz
3. 启动tomcat
# 进入"apache-tomcat-8.5.34" 路径下 cd cd workspace/tomcat/apache-tomcat-8.5.34/ # 启动 bin/startup.sh
4. 访问(http://192.168.105.15:8080/)
5. 把到80端口的服务请求都转到8080端口上(终端运行下面的命令)
sduo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
保存
service iptables save
6. 重启tomcat
# 进入"apache-tomcat-8.5.34" 路径下 cd cd workspace/tomcat/apache-tomcat-8.5.34/ # 关闭tomcat bin/shutdown.sh # 启动 bin/startup.sh
7. 访问(http://192.168.105.15)