• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how u keep directory browsing off

 
sachin yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

can anybdy pl. tell me how i can switch off the directory browsing on my tomcat 5.5 server.

regards,
sachin.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how this "u" guy does it, but I simply put an index.html file in the folder and that prevents any directory from appearing.

Tomcat 5.5 may have added a config entry for this, but I'm pretty sure earlier versions did not have one.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The parameter you want is in the web.xml definition of the default servlet - which is what is generating those directory listings. The default web.xml file is in the conf directory.

Just change the param-value associated with the init-param named listings from true to false.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too cool! I looked everywhere except the default web.xml.
 
sachin yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i agree bear that itz risky to play with web.xml but i think this is the best and easiest way to do this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sachin yadav:
i agree bear that itz risky to play with web.xml


Not at all. I "play" with web.xml files all the time.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic