Home
TeamSite
Directory listing in Tomcat
JTNeville
The included Tomcat with the 4.1 MP webapp allows directory listing. Here's a quick edit to turn this "feature" off.
Open the file web.xml which is located inside $CATALINA_HOME/conf/. This is the global web.xml file, which means that any changes here will affect ALL web applications deployed by that Tomcat instance. If you want more granular control, like turning it off for certain applications but not for others, you will need to go with the first option of creating index.html files.
Locate the following section:
<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>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
</sect1>
This is the first section in web.xml. The options that concern us are :
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
*************************************
Change <param-value> to false and you turn off directory listing.
*************************************
Find more posts tagged with
Comments
There are no comments yet