Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to avoid directory listing?

 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the users types in an url for a directory ( like http://www.myDomain.com/myApp/dir/ ) tomcat displays the directory listing.

How can I deny permission for the users to see the directory listing. Is it possible to control it in the server.xml?
 
Gerardo Tasistro
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is done in the web.xml. Go to conf/web.xml in your tomcat install. Looke for the following code and replace true for false



As shown below

 
Jason Moors
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to change the Default servlet listing parameter in $CATALINA_HOME/conf/web.xml

 
Jeppe Sommer
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. That works :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic