用.htaccess 禁止某IP访问 Order Allow,Deny Allow from all Deny from 1.1.1.1 2.2.2.2 3.3.3.3 允许所有,禁止xxxx,请将里面的IP改成你要封杀的IP地址.并另存为.htaccess,上传到网站根目录. 禁止IP段 Order Allow,Deny Allow from all Deny from 192.168.1 以上相当于禁止192.168.1.1-192.168.1.254 附录:使用详解 Allow和Deny可
service iptables status 查看防火墙状态 service iptables start 开启防火墙 service iptables stop 关闭防火墙 service iptables restart 重启防火墙 防火墙开放特定端口 文件/etc/sysconfig/iptables 添加端口 重启防火墙 禁止某个IP访问 iptables -A INPUT -p tcp -s 192.
由于最近在配置负载均衡环境 外网使用Nginx做代理,分发到Apache服务器上,所以不希望Apache配置的服务被外网访问,只希望内网Nginx访问,所以只能使用局域网IP访问 配置方法: 打开Apache配置文件 vim /etc/httpd/conf/httpd.conf 配置成下面这样 <Directory "/var/www"> Options All AllowOverride None Order Deny,Allow Deny From all Allow