隨筆-295  評論-26  文章-1  trackbacks-0

          Centos 

          辛辛苦苦編譯安裝完Ngnix,mysql ,PHP,后發現不能訪問,后來發現是防火墻把80端口給禁用了。開啟之:(以下參考自:http://llhdf.javaeye.com/blog/526176)

           
          #/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT 
          #/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT 
           
          然后保存: 
          #/etc/rc.d/init.d/iptables save 
           
          再查看是否已經有了: 
          [root@vcentos ~]# /etc/init.d/iptables status 
          Table: filter 
          Chain INPUT (policy ACCEPT) 
          num  target     prot opt source               destination         
          1    ACCEPT     udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:80 
          2    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 
          3    RH-Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0           
           
          Chain FORWARD (policy ACCEPT) 
          num  target     prot opt source               destination         
          1    RH-Firewall-1-INPUT  all  --  0.0.0.0/0            0.0.0.0/0
          二.重啟電腦。
           
          1.CentOS操作系統防火墻默認已經開放了80和22端口
           
          2.這里應該也可以不重啟計算機:
          #/etc/init.d/iptables restart
          防火墻的關閉,關閉其服務即可:
           
          3.查看防火墻信息:
          #/etc/init.d/iptables status
           
          4.關閉防火墻服務:
          #/etc/init.d/iptables stop
           
          三.永久關閉防火墻
           
          我們也可以永久的關閉防火墻,但是我不建議大家這樣做.永久關閉防火墻可以這樣:
          #chkconfig –level 35 iptables off
          也可以直接修改
          /etc/sysconfig/iptables
          添加一條
          -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT


          大盤預測 國富論
          posted on 2015-08-14 19:02 華夢行 閱讀(445) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 朝阳市| 禄劝| 景德镇市| 阳东县| 察隅县| 临沂市| 清丰县| 河北省| 靖宇县| 镇江市| 赣州市| 渝中区| 光泽县| 汉寿县| 醴陵市| 上蔡县| 阜南县| 临沂市| 东丰县| 治多县| 嘉黎县| 庆云县| 淳安县| 萨嘎县| 内黄县| 阿瓦提县| 石泉县| 古田县| 阿合奇县| 商丘市| 梧州市| 彩票| 双流县| 襄垣县| 阳城县| 鸡东县| 黄山市| 凭祥市| 荔浦县| 梨树县| 襄汾县|