[note] Disable direct ip access in Apache2 ubuntu 20.04

 




Edit or create a default vhost and put this inside:

<VirtualHost *:80> 
     ServerName xxx.xxx.xxx.xxx 
     403 / DocumentRoot /var/www/html 
</VirtualHost>


xxx.xxx.xxx.xxx is your server ip address

After that restart your apache

sudo a2ensite your-vhost.conf 
sudo systemctl restart apache2



source: Stackoverflow 

Tidak ada komentar: