tomcat
第一步
yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps
第二步
开机启动
chkconfig --listy
chkconfig tomcat6 on
第三步设
80转发到8080
防火墙规则
vi /etc/sysconfig/iptables 打开配置文件加入如下语句:
/etc/init.d/iptables restart
# Generated by iptables-save v1.4.7 on Wed Oct 14 19:17:52 2015
*nat
:PREROUTING ACCEPT [1:40]
:POSTROUTING ACCEPT [3:228]
:OUTPUT ACCEPT [3:228]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
-A OUTPUT -o lo -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
COMMIT
# Completed on Wed Oct 14 19:17:52 2015
# Generated by iptables-save v1.4.7 on Wed Oct 14 19:17:52 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [223:25494]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Wed Oct 14 19:17:52 2015
service iptables restart
service tomcat6 start
service tomcat6 stop
service tomcat6 restart
按照以上方法安装tomcat6默认目录在/usr/share/tomcat6/下
配置文件默认目录在/etc/tomcat6/下
查看使用端口
第一步
yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps
第二步
开机启动
chkconfig --listy
chkconfig tomcat6 on
第三步设
80转发到8080
防火墙规则
vi /etc/sysconfig/iptables 打开配置文件加入如下语句:
/etc/init.d/iptables restart
# Generated by iptables-save v1.4.7 on Wed Oct 14 19:17:52 2015
*nat
:PREROUTING ACCEPT [1:40]
:POSTROUTING ACCEPT [3:228]
:OUTPUT ACCEPT [3:228]
-A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
-A OUTPUT -o lo -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
COMMIT
# Completed on Wed Oct 14 19:17:52 2015
# Generated by iptables-save v1.4.7 on Wed Oct 14 19:17:52 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [223:25494]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
# Completed on Wed Oct 14 19:17:52 2015
service iptables restart
service tomcat6 start
service tomcat6 stop
service tomcat6 restart
按照以上方法安装tomcat6默认目录在/usr/share/tomcat6/下
配置文件默认目录在/etc/tomcat6/下
查看使用端口
netstat -tunlp
tomcat 支持中文 要改一下server.xml 文件 端口 处。加入utf-8