apache设置禁止IP访问网站

可以在http.conf中添加下列信息,或者httpd-vhosts.conf启用时在httpd-vhosts.conf中添加也可以。 VirtualHost

可以在http.conf中添加下列信息,或者httpd-vhosts.conf启用时在httpd-vhosts.conf中添加也可以。

<VirtualHost *:80>ServerName 0.0.0.0<Location />Order Allow,DenyDeny from allLocation>
VirtualHost>

0.0.0.0为公网IP