zoukankan      html  css  js  c++  java
  • centos 6.5 apache配置web应用&防火墙设置(入门级)

    硬件:centos 6.5 服务器 , Dell R420 , 两个网口,一个给公网,一个给内网。

    软件:apache 2.2

    配置了virtualhost以后,用curl在本地可以访问。但是其他机器不可以。googel了一把,掌握了几个调试技巧:

    1. ping ,curl 查看ip是否可通,页面是否可以抓取。netstat -tulpn , 查看端口是否处于监听状态,如果下面这样就ok,否则需要配置httpd.conf,加上Listening 80

    tcp    0    0 :::80     :::*    LISTEN  
    

    2. 如果端口处于监听状态,查看iptables规则,使用iptables -l , 正常情况下应该有这条:

    ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http 
    

     表示,http协议可以通过任何接口。

    如果没有,则需要用以下指令添加这条规则:

    sudo iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
    sudo /etc/init.d/iptables save
    

    参考地址:http://stackoverflow.com/questions/10729247/apache-not-accepting-incoming-connections-from-outside-of-localhost

  • 相关阅读:
    make ubuntu desktop beautiful
    scratch 编程第二弹
    stratch pragramming
    emacs 安装与基本设置-1
    linux相关命令
    7-12
    python strip()
    python 正则表达式 re.sub & re.subn
    python 正则表达式 re.findall &re.finditer
    python 正则表达式 re.split
  • 原文地址:https://www.cnblogs.com/Tommy-Yu/p/4372686.html
Copyright © 2011-2022 走看看