---
title: "CenOS apache 默认不能访问"
author: "afeix"
date: "2012-10-11T14:12:26Z"
tags: []
categories: ["操作系统"]
slug: "cenos-apache"
draft: false
lastmod: "2012-10-19T08:26:19Z"
id: 1696407
url: "https://afeix.iteye.com/blog/1696407"
---

CentOS 默认安装Apache，通过IP不能访问，可能是因为系统本身的IP限制，试试下面的命令：

iptables -I INPUT -p TCP --dport 80 -j ACCEPT  

可能会解决。

 

使用命令：

iptables -I INPUT -p TCP --dport 22 -j ACCEPT  

打开TCP 22 端口（SSH远程登录）

重启后上面两个命令失效，要想保存,使用：service iptables save 命令。