控制原理
在iis或apach里添加非法指向域名,域名的内容再指向标准404错误输出。
可以对未授权的域名及IP进行控制,以达到域名备案控制的要求。
iis 指向标准404
只需把网站目录里的文件删除即可。
apach 指向标准404
通过修改httpd.conf
删除出前面的 # 号 就可以报出 标准的出错信息。以名ip 访问时直接出现不符备案要求的内容
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
修改httpd.conf文件 ,注意配置顺序。把Ip 或 空主机头的禁用配置要写到最前面。
vi /etc/httpd/conf/httpd.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName 119.252.240.20 (119.252.240.20假定为服务器ip)
<Location />
Order Allow,Deny
Deny from all
</Location>
</VirtualHost>
<VirtualHost *:80>
ServerName m176.net
ServerAlias www.m176.net
DocumentRoot /www/app
ErrorLog logs/app-error.log
CustomLog logs/app-access.log common
<Directory "/www/app">
#Options +Indexes +FollowSymLinks
Options +Includes +FollowSymLinks
AllowOverride all
#Order Deny,Allow
#Allow from all
</Directory>
</VirtualHost>