Disabling directory listing in Apache2

(first method)
/etc/apache2/httpd.conf

<Directory /var/www>
  Options -Indexes
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

(second method)
.htaccess file
    Options -Indexes
    The minus means "no"
    
httpd.conf or .htaccess
IndexIgnore *.pdf *.mp3
IndexIgnore *