apachevirtualhostvirtual-hosts

Disable directory listing on apache; but access to individual files should be allowed


I do not want to use .htaccess. How should I change my Directory attributes?

<VirtualHost *:80>
   ServerName abc.com
   DocumentRoot /usr/share/uploads
   <Directory " /usr/share/uploads">
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

Solution

  • I really couldnt find a direct answer on internet ; even on apache documentation. Finally, could find the solution through few iterations; we need to use Options and the value should NOT contain Indexes.

    <Directory "/usr/share/uploads">
            Options Includes FollowSymLinks MultiViews
            AllowOverride None
             Order allow,deny
          Allow from all
       </Directory>