How to Disable directory Listing Directory browsing in apache Web Server

  1. Go to “/etc/apache2/apache2.conf”
  2. Change the following code 
    <Directory /var/www/>
     Options Indexes FollowSymLinks
     AllowOverride None
     Require all granted
    </Directory>

    Change above code as like below. Removed Indexes from first line.

    <Directory /var/www/>
    Options FollowSymLinks
    AllowOverride None
    Require all granted
    </Directory>

    Please follow the below video instruction:

  3. Restart Apache 2 web server, enter:

    # /etc/init.d/apache2 restart
    OR
    $ sudo /etc/init.d/apache2 restart
    OR
    $ sudo service apache2 restart

Leave a Reply

Your email address will not be published. Required fields are marked *