Howdy,

>I have Linux server running Tomcat 4.1.24 with several virtual hosts. I
>want to disable directory listings in all but one specific virtual
host.
>Does anybody know if this is possible?.
>The only thing I could do was to disable or enable entirely the
>directory listings by setting the "listings" parameter to "false" in
>$CATALINA_HOME/conf/web.xml

The easy answer is no: you can only do it for the whole server by
changing the setting which you've already done.

But there's a more complicated answer that does work.  The listings
parameter is for the default servlet as you know by now.  The
conf/web.xml, and the default servlet, is loaded once per context.  So
you can take the default servlet out of conf/web.xml into the web.xml
files of your own applications.  Which means you can configure selected
contexts to display or hide directory listings.  Taking it to the next
level, the Host level, is just more copy and paste.  So, to enable
directory listings for Host A, declare the default servlet in every
web.xml in Host A with listings=true.  To disable directory listings for
Host B, declare the default servlet in every web.xml in Host B with
listings=false.  And take out the default servlet altogether from
conf/web.xml.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to