zoukankan      html  css  js  c++  java
  • tomcat启动后,页面无法访问

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

    检查点:

    1)检查 omcatconfweb.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)检查 omcatwebappsROOT下有哪些文件,是否有上述配置里的页面,若无,则手动添加一个

    3)检查 omcatconfserver.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

  • 相关阅读:
    c# 并行运算二
    c# 并行运算
    Task+http请求
    Task多线程
    SSO系统认证
    web系统权限设计
    AutoMapper的使用
    中间件
    express-middleware
    中间件概念
  • 原文地址:https://www.cnblogs.com/joewu/p/4208236.html
Copyright © 2011-2022 走看看