Tomcat – HTTP 404 – /docs/appdev/ on fresh netbeans tomcat 7 install

documentationhttp-status-code-404javatomcat

As part of re-installing NetBeans 7.0.1, I had Tomcat 7.0.14 installed too on my PC. I created a manager role too. I can access http://localhost:8084/manager/html successfully.

<role rolename="manager-gui" />
<user username="tomcat" password="tomcat" roles="manager-gui"/> 

However, when I try to access documentation, like http://localhost:8084/docs/setup.html, I get a HTTP 404 resource not available. I checked in the installation directory and /webapps/docs/setup.html does exist.

What am I doing wrong? What am I missing? Thanks.

EDIT

Here is the Host content of server.xml:

  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true">

    <!-- SingleSignOn valve, share authentication between web applications
         Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->

    <!-- Access log processes all example.
         Documentation at: /docs/config/valve.html
         Note: The pattern used is equivalent to using pattern="common" -->
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
           prefix="localhost_access_log." suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" resolveHosts="false"/>

  </Host>

I could not find any catalina.out files in the log directory (or elsewhere).

Best Answer

Check the value of the CATALINA_BASE environment variable. It's in the top of the Apache Tomcat Output window in NetBeans:

Using CATALINA_HOME: /opt/apache-tomcat-7.0.14
Using CATALINA_BASE: /home/user/.netbeans/7.0/apache-tomcat-7.0.14.0_base

The value of CATALINA_BASE is different than CATALINA_HOME. CATALINA_HOME is where Tomcat's binaries are and settings are in CATALINA_BASE. Tomcat runs those webapps which have a config in this (CATALINE_BASE) directory. The exact place is (in my case) /home/user/.netbeans/7.0/apache-tomcat-7.0.14.0_base/conf/Catalina/localhost.

Just put a docs.xml to the /home/user/.netbeans/7.0/apache-tomcat-7.0.14.0_base/conf/Catalina/localhost folder with the following:

<Context docBase="${catalina.home}/webapps/docs" />

Then restart Tomcat.