IndianWebPortal.com

Something Different In Linux

Home » Email Marketing Series » disable directory listing in tomcat

disable directory listing in tomcat

Posted by Rishikesh Vispute Categories: Email Marketing Series, How to, Tomcat

How to disable directory listing in Tomcat? + cPanel server ?

Ans :

By default the directory listing is enabled on the tomcat  server. You can disable it by using the following steps.

There are basically 2 methods of “turning off” this option :

* Create an index.jsp  file and place it in the web application’s directory ( under the document root )
* Edit the global web.xml file to turn off the option.

If you want to disable the directory listing for single domain then chose the first option but if you want to disable it server wide or all all account which is hosted on the server then choose the second option.

First option is simple , you need to create the index.jsp page  or index.php page under the document root of the domain name . When you have access the domain name then it shows index.jsp or index.html page.

And for the second option you need to change the default server web.xml file

1. Open the  web.xml file.

vi /usr/local/jakarta/tomcat/conf/web.xml

2. Look for the <init-param> section within the <servlet section>

<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>

3. Change the <param-value> to false for the <param-name>listing</param-name> section.

<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>

Restart the tomcat service on the server.


Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...