安裝apache 后默認(rèn)網(wǎng)站是可以通過ip訪問的叶骨,所以可能會有些惡意的域名指向你的網(wǎng)站。
遇到這種情可以建一個默認(rèn)的站點(diǎn) (注意疼邀,要保證這個的站點(diǎn)在所有站點(diǎn)的最前面誓焦,可以通過ip直接訪問此站)
<VirtualHost *:80>
ServerAdmin webmaster@localhost DocumentRoot /var/www
<Directory />
Options Indexes FollowSymLinks MultiViews AllowOverride None Order deny, deny from all #直接屏蔽所有人訪問
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>