其他的域名指向了自己的IP地址,比如www.ytu.edu.cn是我学校的正常域名,经常有恶意域名指向这个IP地址202.194.116.18,比如www.uxwm.com,也指向了这个IP地址,IP地址绑定域名,仅通过该域名可以访问这个IP地址;
修改tomcat 7的server.xml配置,在<Engine>增加属性defaultHost="notexists"
<Engine name="Catalina" defaultHost="notexists"> <!--正常网站,将只能通过www.ytu.edu.cn域名访问--> <Host name="www.ytu.edu.cn" appBase="/opt/www" unpackWARs="true" autoDeploy="true"> </Host> <!--恶意注册的域名,将显示404错误--> <Host name="notexists" appBase="notexists" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"></Host> </Engine>