English

How To: Disable Directory Listing for the built-in Apache Tomcat Web Server on port 8399 with ArcGIS Server for the Java platform

Summary

Instructions provided describe how to disable Directory Listing/Directory Browsing for the built-in Tomcat Web server running on port 8399 with ArcGIS Server for the Java platform.

Procedure

When ArcGIS Server for the Java platform is installed, the internal Apache Tomcat running on port 8399 will set Directory Listing enabled by default. This can be a very useful debugging tool, but for production deployments, this should be turned off.

Note:
Apache Tomcat uses the term Directory Listing instead of Directory Browsing as in Microsoft Internet Information Services (IIS).

  • Method 1

    Create a blank index.html file and put this index.html file in the docBase C:\Program Files\ArcGIS\java\web_output folder, which prevents the directory from appearing.

    (Optional)
    Instead of using a blank index.html page, any Web page, for example, Server Manager page or even Corporate Intranet Home Page, can be redirected.

    For instance, put an index.jsp page under this location, C:\Program Files\ArcGIS\java\web_output, will redirect to the Server Manager page.

    Example of content of the index.jsp file can be found below:
    Code:
    <% response.sendRedirect("http://localhost:8099/arcgismanager/index.html"); %>

  • Method 2

    Edit the global web.xml file to turn off the option.

    The parameter for this Directory Listing is in the web.xml definition of the internal Apache Tomcat, which is what is generating those directory listings. The default web.xml file is in the conf directory.

    1. Edit the following file with a text editor such as Notepad.

    C:\Program Files\ArcGIS\java\manager\service\tomcat\managerappserver\conf\web.xml

    2. Search for the following tag:
    Code:
    <init-param>
    <param-name>listings</param-name>
    <param-value>true</param-value>
    </init-param>

    3. Change the param-value associated with the init-param named listings from true to false. The new tag should look like the tag below:
    Code:
    <init-param>
    <param-name>listings</param-name>
    <param-value>false</param-value>
    </init-param>

    4. Restart the 'ArcGIS Server Manager Service' in the Windows Services.

    5. An attempt to open the page http://<server_name>:8399 yields an HTTP Status 404 error.

Related Information