sudo apt install apache2
go to apache2.conf
sudo nano /etc/apache2/apache2.conf
and remove ‘Indexes’ to hide the content of the directory if index.html or index.php are missing:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>