Default Virtual Host
To prevent other domain names from being resolved to their own IP, we can restrict other domain names by changing the virtual host file/usr/local/apache2/conf/extra/httpd-vhosts.con. We create a new virtual host, create a new empty directory and set its permissions to 600. This allows only the domain names that we define in the configuration file to be accessible.
The command is as follows:
Vim/usr/local/apache2/conf/extra/httpd-vhosts.conf
Add the following code to the location of the first virtual host:
<virtualhost *:80>
DocumentRoot "/tmp/123"
ServerName 1111.com
</VirtualHost>
Save exit
Mkdir/tmp/123
chmod 600/tmp/123
Apachectl-t
Apachectl restart
This article is from the "Lin Chunje Road" blog, please be sure to keep this source http://kratoslinux.blog.51cto.com/9844108/1771594
Apache Set Default virtual host