You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ben Souther <bs...@fwdco.com> on 2004/02/19 22:54:57 UTC

Disable Directory Listing for Specific Apps.

Is it possible to disable directory listings for a specific web app as opposed 
to editing the global web.xml file in TOMCAT_HOME/conf/web.xml?

We would like to ship our app as a war file and don't want require that our 
customers make global changes to Tomcat for it to behave properly.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Disable Directory Listing for Specific Apps.

Posted by Ben Souther <bs...@fwdco.com>.
This is great,
Thanks Tim.



On Friday 20 February 2004 11:44 am, Tim Funk wrote:
> Just decalre a new default servlet in the local webapp's web.xml. Just be
> sure not to call it default since teh global webapp reserved it.
>
>      <servlet>
>          <servlet-name>mdefault</servlet-name>
>          <servlet-class>
>            org.apache.catalina.servlets.DefaultServlet
>          </servlet-class>
>          <init-param>
>              <param-name>listings</param-name>
>              <param-value>false</param-value>
>          </init-param>
>      </servlet>
>      <servlet-mapping>
>          <servlet-name>mdefault</servlet-name>
>          <url-pattern>/</url-pattern>
>      </servlet-mapping>
>
>
> -Tim
>
> Ben Souther wrote:
> > That would do except that we are allowing customers to create directories
> > and have no guarantee that the welcome file will exist there.
> >
> > It would be nice if we could disable directory listing for the entire app
> > from within the war file.  We have no guarantee that they won't be using
> > the same instance of Tomcat for other apps and we are hoping to avoid
> > walking customers through editing the global web.xml file.
> >
> > It's starting to look like this isn't possible..  :-(
> >
> > On Thursday 19 February 2004 05:44 pm, Parsons Technical Services wrote:
> >>If I understand the notes correctly, if you simply include a welcome file
> >>then TC will not serve up the directory listing. This is also how my
> >> setup acts. It will not show the directory for my app which has an index
> >> file. And the global web.xml is untouched.
> >>
> >>See the notes in the global web.xml and Servlet 2.4 specifications.
> >>
> >>Doug
> >>www.parsonstechnical.com
> >>
> >>
> >>----- Original Message -----
> >>From: "Ben Souther" <bs...@fwdco.com>
> >>To: "Tomcat Users List" <to...@jakarta.apache.org>
> >>Sent: Thursday, February 19, 2004 4:54 PM
> >>Subject: Disable Directory Listing for Specific Apps.
> >>
> >>
> >>Is it possible to disable directory listings for a specific web app as
> >>opposed
> >>to editing the global web.xml file in TOMCAT_HOME/conf/web.xml?
> >>
> >>We would like to ship our app as a war file and don't want require that
> >> our customers make global changes to Tomcat for it to behave properly.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

-- 
Ben Souther
F.W. Davison & Company, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Disable Directory Listing for Specific Apps.

Posted by Tim Funk <fu...@joedog.org>.
Just decalre a new default servlet in the local webapp's web.xml. Just be 
sure not to call it default since teh global webapp reserved it.

     <servlet>
         <servlet-name>mdefault</servlet-name>
         <servlet-class>
           org.apache.catalina.servlets.DefaultServlet
         </servlet-class>
         <init-param>
             <param-name>listings</param-name>
             <param-value>false</param-value>
         </init-param>
     </servlet>
     <servlet-mapping>
         <servlet-name>mdefault</servlet-name>
         <url-pattern>/</url-pattern>
     </servlet-mapping>


-Tim

Ben Souther wrote:
> That would do except that we are allowing customers to create directories and 
> have no guarantee that the welcome file will exist there.  
> 
> It would be nice if we could disable directory listing for the entire app from 
> within the war file.  We have no guarantee that they won't be using the same 
> instance of Tomcat for other apps and we are hoping to avoid walking 
> customers through editing the global web.xml file.
> 
> It's starting to look like this isn't possible..  :-(
> 
> 
> 
> 
> On Thursday 19 February 2004 05:44 pm, Parsons Technical Services wrote:
> 
>>If I understand the notes correctly, if you simply include a welcome file
>>then TC will not serve up the directory listing. This is also how my setup
>>acts. It will not show the directory for my app which has an index file.
>>And the global web.xml is untouched.
>>
>>See the notes in the global web.xml and Servlet 2.4 specifications.
>>
>>Doug
>>www.parsonstechnical.com
>>
>>
>>----- Original Message -----
>>From: "Ben Souther" <bs...@fwdco.com>
>>To: "Tomcat Users List" <to...@jakarta.apache.org>
>>Sent: Thursday, February 19, 2004 4:54 PM
>>Subject: Disable Directory Listing for Specific Apps.
>>
>>
>>Is it possible to disable directory listings for a specific web app as
>>opposed
>>to editing the global web.xml file in TOMCAT_HOME/conf/web.xml?
>>
>>We would like to ship our app as a war file and don't want require that our
>>customers make global changes to Tomcat for it to behave properly.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Disable Directory Listing for Specific Apps.

Posted by Jerry Ford <jf...@katzenjammer.us>.
Ben:

The proverbial $.02 of opinion:  If the customer owns the directory, 
then doesn't the customer also own the decision to allow files in it to 
be listed?

Seems like it is an easier documentation problem to explain how to 
prevent listings ("include an index.html file in your directory if you 
don't want...blah blah blah") than to explain how to edit the global 
web.xml file.  Also a less perilous task for the user, since a typo in 
the web.xml file could screw up everything.

Jerry


Ben Souther wrote:

>That would do except that we are allowing customers to create directories and 
>have no guarantee that the welcome file will exist there.  
>
>It would be nice if we could disable directory listing for the entire app from 
>within the war file.  We have no guarantee that they won't be using the same 
>instance of Tomcat for other apps and we are hoping to avoid walking 
>customers through editing the global web.xml file.
>
>It's starting to look like this isn't possible..  :-(
>
>
>
>
>On Thursday 19 February 2004 05:44 pm, Parsons Technical Services wrote:
>  
>
>>If I understand the notes correctly, if you simply include a welcome file
>>then TC will not serve up the directory listing. This is also how my setup
>>acts. It will not show the directory for my app which has an index file.
>>And the global web.xml is untouched.
>>
>>See the notes in the global web.xml and Servlet 2.4 specifications.
>>
>>Doug
>>www.parsonstechnical.com
>>
>>
>>----- Original Message -----
>>From: "Ben Souther" <bs...@fwdco.com>
>>To: "Tomcat Users List" <to...@jakarta.apache.org>
>>Sent: Thursday, February 19, 2004 4:54 PM
>>Subject: Disable Directory Listing for Specific Apps.
>>
>>
>>Is it possible to disable directory listings for a specific web app as
>>opposed
>>to editing the global web.xml file in TOMCAT_HOME/conf/web.xml?
>>
>>We would like to ship our app as a war file and don't want require that our
>>customers make global changes to Tomcat for it to behave properly.
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>    
>>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Disable Directory Listing for Specific Apps.

Posted by Ben Souther <bs...@fwdco.com>.
That would do except that we are allowing customers to create directories and 
have no guarantee that the welcome file will exist there.  

It would be nice if we could disable directory listing for the entire app from 
within the war file.  We have no guarantee that they won't be using the same 
instance of Tomcat for other apps and we are hoping to avoid walking 
customers through editing the global web.xml file.

It's starting to look like this isn't possible..  :-(




On Thursday 19 February 2004 05:44 pm, Parsons Technical Services wrote:
> If I understand the notes correctly, if you simply include a welcome file
> then TC will not serve up the directory listing. This is also how my setup
> acts. It will not show the directory for my app which has an index file.
> And the global web.xml is untouched.
>
> See the notes in the global web.xml and Servlet 2.4 specifications.
>
> Doug
> www.parsonstechnical.com
>
>
> ----- Original Message -----
> From: "Ben Souther" <bs...@fwdco.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Thursday, February 19, 2004 4:54 PM
> Subject: Disable Directory Listing for Specific Apps.
>
>
> Is it possible to disable directory listings for a specific web app as
> opposed
> to editing the global web.xml file in TOMCAT_HOME/conf/web.xml?
>
> We would like to ship our app as a war file and don't want require that our
> customers make global changes to Tomcat for it to behave properly.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

-- 
Ben Souther
F.W. Davison & Company, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Disable Directory Listing for Specific Apps.

Posted by Parsons Technical Services <pa...@earthlink.net>.
If I understand the notes correctly, if you simply include a welcome file
then TC will not serve up the directory listing. This is also how my setup
acts. It will not show the directory for my app which has an index file. And
the global web.xml is untouched.

See the notes in the global web.xml and Servlet 2.4 specifications.

Doug
www.parsonstechnical.com


----- Original Message ----- 
From: "Ben Souther" <bs...@fwdco.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, February 19, 2004 4:54 PM
Subject: Disable Directory Listing for Specific Apps.


Is it possible to disable directory listings for a specific web app as
opposed
to editing the global web.xml file in TOMCAT_HOME/conf/web.xml?

We would like to ship our app as a war file and don't want require that our
customers make global changes to Tomcat for it to behave properly.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org