tomcat启动后,页面无法访问

 tomcat安装成功后并启动 ./startup.sh, 访问 http://ip:8080 ,提示无法访问

检查点:

1)检查\tomcat\conf\web.xml配置,可访问哪些页面

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

 

2)检查\tomcat\webapps\ROOT下有哪些文件,是否有上述配置里的页面,若无,则手动添加一个

3)检查\tomcat\conf\server.xml配置,tomcat设置的是哪个端口

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

 4)检查server.xml配置的端口是否有打开  netstat -an | grep 8080

有的话,则显示tcp        0      0 :::8080                     :::*                        LISTEN

没有的话,需要手动开启 nc -lp 8080 & (此命令来源于网络,使用时提示nc命令不存在,需要安装yum install nc --nogpgcheck)

查看端口被什么程序占用 lsof -i:8080

5)检查防火墙是否允许端口通过 vi /etc/sysconfig/iptables

若不存在当前配置的端口,则需要手动添加 -A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT

并重启防火墙,使之生效 /etc/init.d/iptables restart

 

posted on 2015-01-07 13:32  娇娇家的美衣阁  阅读(4361)  评论(0编辑  收藏  举报

导航