Kees de Kooter
03-10-2008, 07:33
By default directory listing is enabled in tomcat 5. This is fine for development purposes but not desirable in production deployments.
To disable this for the entire tomcat server go to $CATALINA_HOME/conf/web.xml and set the listings parameter to false.
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
</sect1>
In tomcat 6 the default changed to false.
To disable this for the entire tomcat server go to $CATALINA_HOME/conf/web.xml and set the listings parameter to false.
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
</sect1>
In tomcat 6 the default changed to false.