Edit your apache2 configuration file which normally is on the dir: “/etc/apache2/httpd.conf”.
Add the following or edit if your already have some configurations for the default web server dir (/var/www):
<Directory /var/www>
Options -Indexes
AllowOverride All
Order allow,deny
Allow from all
</Directory>
This will disable the indexing to all the public directories.