вс, 2 июл. 2023 г. в 01:50, Graham Leggett <minf...@sharp.fm.invalid>:
>
> Hi all,
>
> I have for a while now been moving various web applications onto a new 
> machine running tomcat9, and things have been working great. I have suddenly 
> reached one web application which is silently ignored.
>
> Tomcat starts up without any error, makes no mention of the webapp. If the 
> webapp points to a bogus directory, tomcat complains very loudly, point 
> tomcat to the correct directory, tomcat ignores the webapp.
>
> Any attempt to hit the webapp returns the dreaded tomcat 404 page. 
> Interestingly hitting /foo/bar returns a redirect to /foo/bar/ (as you would 
> expect it to), but /foo/bar/ returns a tomcat 404.
>
> The webapp is not being newly developed, and works fine on tomcat7 on the old 
> machine.
>
> Is there anything that can be done to coax an error message or any message 
> out of tomcat when it fails to deploy something?
>
> Snip of server.xml looks like this:
>
>       <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" />
>
>         <Context path=“/foo/bar" docBase="/usr/share/foo-bar">
>
>         </Context>

1. Please read
https://tomcat.apache.org/tomcat-9.0-doc/config/context.html#Defining_a_context

You are injecting a Context into a Host at the time when the
server.xml file is parsed. It does not go through the proper
"deployment" processing at start time.

2. What result did you expect?

The default behaviour is to look for a welcome-file, such as
"index.html". Do you have one?

The possible names of welcome files are configured by
"welcome-file-list" setting in the WEB-INF/web of a web application.
(The defaults, shared by all web applications, are configured with the
conf/web.xml file in Tomcat configuration.)

Alternatively, you may reconfigure the DefaultServlet (by copying its
servlet and servlet-mapping configuration from the conf/web.xml file
into your web application) and enable directory listings. Those are
off by default.

https://tomcat.apache.org/tomcat-9.0-doc/default-servlet.html

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