Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: improving an answer

...

How do I enable/disable directory listings?

This To make a global change, this is done in TOMCAT_HOME/conf/web.xml by changing the listings property for the default servlet.

If you want to enable it for an individual webapp, then you need to add something similar to the following to your web.xml file:

No Format

   <servlet>
       <servlet-name>listing</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>

   <servlet-mapping>
       <servlet-name>listing</servlet-name>
       <url-pattern>/</url-pattern>
   </servlet-mapping>

How do I make Tomcat listen on a specific IP address instead of all available addresses?

...