httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kutter <l...@wmk.ch>
Subject Re: [users@httpd] how to prevent directory listing
Date Mon, 03 Jul 2006 07:06:27 GMT
Hi Rajesh

 > How can I prevent directory listings of my server?

To prevent directory listing, you have (as far as I know) 3 options:

1. Put an empty index/default-Page in each directory (i.e. index.html)
--> of course, this is inefficient, but works (there are still hosters 
out there, that offer you this as a 'solution'!)

2. .htaccess-File, insert the following line:
Options +Indexes
--> This will only work if your apache.conf (or httpd.conf, or 
apache2.conf) allows .htaccess-configuration (AllowOverride etc.)


3. Change httpd.conf/or apache2.conf file
<Directory /var/web/site>
         Options -FollowSymLinks -Indexes
</Directory>

or something like this.






 > What configurations required at http server and tomcat?

As far as I know, it depends on whether you run/install tomcat 
'standalone' or as apache-tomcat (under apache).
Anyway, there is a directive for your web.xml-file:

<init-param>
             <param-name>listings</param-name>
             <param-value>false</param-value>
</init-param>

which prevents directory listing.

Hope this helps!
Regards
QT


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message