Hide directory tree in Apache server

Take me hours to figure this crap out. Anyways, here’s the short story:


Open apache configuration file:

sudo nano /etc/apache2/apache2.conf


Scroll down to the <Directory /var/www/>. Add Options -Index and comment Option Indexes FollowSymLinks like so:

<Directory /var/www/>
    Options -Indexes
#    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted


That’s all you have to do to hide the directory list. Happy Programming! DX