Recently I got a illegal domain pointing to our company's website, here is the solution for Apache to get away from this kind of issue.

I presume you've already using a vhost based config file to enable your domain and web host, now you got another illegal domain pointing to this web host as well. 

First, edit your vhost file:

 

<VirtualHost www.xxx.cn:80>

        ServerName www.xxx.cn

        ServerAdmin yyy.xxx@xxxx.cn

        DocumentRoot /var/www/xxxx/

        ErrorLog /var/log/apache2/error.log

        CustomLog /var/log/apache2/access.log combined

</VirtualHost>

And then edit your default site file, make sure there is a SeverName option in this website and now any other illegal domain won't work anymore.

 

0 评论: