On Mon, Sep 11, 2017 at 9:40 AM, Mark Thomas <ma...@apache.org> wrote:
> On 08/09/17 23:00, Chris Cheshire wrote:
>> In tomcat8, how do I go about configuring a Resources element to
>> replace mod_alias directives in httpd?
>
> <snip/>
>
>> I have tried all kinds of variations of
>>
>>   <Resources>
>>     <PreResources base="/var/cdn/sandbox1/images"
>>                   className="org.apache.catalina.webresources.DirResourceSet"
>>                   webAppPath="/images" />
>>   </Resources>
>>
>>
>> in my context.xml and I get nothing but 404s from tomcat.
>
> Check the logs for error messages. You need "webAppMount" rather than
> "webAppPath". The following works for me:
>

/facepalm

There was nothing however in catalina.log. Fiddling around, it seems that is due
to the way apps are deployed on the fly via the manager webapp vs
tomcat restarting.

I usually deploy as an exploded directory due to needing to change configuration
before deployment (no, I don't have an ant build that sets it all up,
lack of time/resources)
and on the fly changes of JS/CSS/JSPs. (I know that isn't a good practice for a
production deployment, but it is what I have to work with)

I found ROOT.xml in conf/Catalina/${hostname} as a copy of META-INF/context.xml
BEFORE I made the changes, therefore the invalid config was never being read,
hence no errors.

I was under the impression that restarting tomcat picked up changes to
META-INF/context.xml. However it seems that if the app is deployed on the
fly with the manager webapp it copies context.xml into the conf tree,
but if the exploded
directory is present when tomcat restarts it doesn't copy the
context.xml into the conf tree.
Why doesn't tomcat copy context.xml into the conf tree if it doesn't
exist when it
deploys a webapp on startup?

Chris

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

Reply via email to