чт, 5 сент. 2024 г. в 17:38, David Rush <david.r...@wyo.gov>:
> [...]
>
> I copied the ROOT webapp from my CATALINA_HOME/webapps to my
> CATALINA_BASE/webapps, and I see in my /var/opt/tomcat9/logs/catalina.out
> that it was found:
>
> Sep 05, 2024 2:18:53 PM org.apache.catalina.startup.HostConfig
> deployDirectory
> INFO: Deployment of web application directory
> [/var/opt/tomcat9/webapps/ROOT] has finished in [251] ms
>
> Same for the examples webapp:
>
> Sep 05, 2024 2:18:53 PM org.apache.catalina.startup.HostConfig
> deployDirectory
> INFO: Deploying web application directory
> [/var/opt/tomcat9/webapps/examples]
>
> I'm seeing nothing but 404 errors in my
> /var/opt/tomcat9/logs/localhost_access_log.2024-09-05.txt
>
> Trying http://localhost:8080/ and http://localhost:8080/index.jsp and
> http://localhost:8080/examples/ and
> http://localhost:8080/examples/index.html I only ever get a 404 error.
>
> I can stop the tomcat9.service and then I get a "Cannot connect" error.  So
> I am hitting Tomcat.
>
> I can change the listening port in /var/opt/tomcat9/conf/server.xml which
> means I can get 404 errors on that different port (but demonstrates that
> it's finding the right server.xml in my CATALINA_BASE).
>

1) My guess is that your web applications were deployed but failed to start.

You talk about "catalina.out" but it contains only output from "ConsoleHandler".

ConsoleHandler is configured in conf/logging.properties as
.handlers = 1catalina.org.apache.juli.AsyncFileHandler,
java.util.logging.ConsoleHandler

i.e. it is a handler for the "" (root) logger name.

Web application errors are logged via
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers
= 2localhost.org.apache.juli.AsyncFileHandler

and the "2localhost.*" FileHandler writes to "localhost.*.log" file.
Look there for the messages.

BTW,
I suggest reading "Considerations for production usage" on the Logging
page of the docs., and consider disabling either ConsoleHandler (if
you prefer logging into separate files) or all other configured
FileHandlers (if you prefer logging into catalina.out).
https://tomcat.apache.org/tomcat-9.0-doc/logging.html#Considerations_for_production_usage

Also,
2) index.html and index.jsp are served by DefaultServlet and
JspServlet, respectively.

Usually web applications do not configure them explicitly, but inherit
those servlets from the $CATALINA_BASE/conf/web.xml file.

Is that file OK?

If those servlets are not configured then neither static files nor jsp
files can be served by Tomcat.

3) BTW,
The examples web application is protected by a RemoteAddrValve.
(Configured in its META-INF/context.xml file.)

It is good that you are accessing it via "localhost". Otherwise you
would get 403 errors.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to