tomcat server to avoid malicious domain name registration

Other domain names point to their own IP addresses. For example, www.ytu.edu.cn is the normal domain name of my school. There are often malicious domain names that point to this IP address 202.194.116.18, such as www.uxwm.com, which also point to this IP address. , the IP address is bound to the domain name, and the IP address can be accessed only through the domain name;

Modify the server.xml configuration of tomcat 7 and add the attribute defaultHost="notexists" to <Engine>

<Engine name="Catalina" defaultHost="notexists">

<!--Normal website, will only be accessed through the domain name www.ytu.edu.cn-->

<Host name="www.ytu.edu.cn"  appBase="/opt/www"
            unpackWARs="true" autoDeploy="true">

</Host>

<!--A maliciously registered domain name will display a 404 error-->

<Host name="notexists"  appBase="notexists"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false"></Host>

</Engine>
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326057820&siteId=291194637
Recommended