LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 667|回复: 4

apache配置问题

[复制链接]
发表于 2003-5-9 20:02:37 | 显示全部楼层 |阅读模式
如何只允许想要的几段ip访问主页呢??如何设置啊!
求救啊!!!!
发表于 2003-5-9 20:33:05 | 显示全部楼层
在apache的配置文件httpd.conf里面可以设置允许那些主机访问主页!
发表于 2003-5-9 21:46:45 | 显示全部楼层
编辑文件/etc/httpd/conf
在〈directory "/usr/local/web/apache/cgi-bin">里Allow from后输入网段
发表于 2003-5-9 22:03:58 | 显示全部楼层
也可以使用iptables
iptables -t filter -A INPUT -s 192.168.0.1-192.168.0.5 -p tcp --dport http -j ACCETP
iptables -t filter -A INPUT -s 192.168.0.1-192.168.0.5 -m state --state ESTABLISHED , RELATED -j ACCEPT
iptables - t filter -P INPUT DROP
这样只有192.168.0.1到192.168.0.5的机器能访问你的HTTP服务器
 楼主| 发表于 2003-5-10 12:38:15 | 显示全部楼层
在〈directory "/usr/local/web/apache/cgi-bin">里Allow from后输入网段
好象不行啊!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表