Apache prevents domain names from maliciously pointing to web sites

  • 2020-05-09 19:49:00
  • OfStack

After installing apache, the default website can be accessed through ip, so there may be some malicious domain names pointing to your website.

Set up a default site (note that this site is at the top of all sites and can be accessed directly via ip)


<VirtualHost *:80> 
ServerAdmin webmaster@localhost 
DocumentRoot /var/www 
<Directory /> 
Options Indexes FollowSymLinks MultiViews 
AllowOverride None 
Order deny, 
deny from all # Block access to everyone  
</Directory> 
ErrorLog ${APACHE_LOG_DIR}/error.log 
LogLevel warn 
CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost>


Related articles: