Re: mod_alias equivalent for tomcat 8?

2017-09-11 Thread Mark Thomas
On 11/09/17 16:07, Chris Cheshire wrote:

> Why doesn't tomcat copy context.xml into the conf tree if it doesn't
> exist when it
> deploys a webapp on startup?

That behaviour caused problems for some users so it is configurable. See
copyXML on the Host

Mark

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



Re: mod_alias equivalent for tomcat 8?

2017-09-11 Thread Chris Cheshire
On Mon, Sep 11, 2017 at 9:40 AM, Mark Thomas  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?
>
> 
>
>> I have tried all kinds of variations of
>>
>>   
>> >   className="org.apache.catalina.webresources.DirResourceSet"
>>   webAppPath="/images" />
>>   
>>
>>
>> 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



Re: mod_alias equivalent for tomcat 8?

2017-09-11 Thread Mark Thomas
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?



> I have tried all kinds of variations of
> 
>   
>className="org.apache.catalina.webresources.DirResourceSet"
>   webAppPath="/images" />
>   
> 
> 
> 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:


  

  


in $CATALINA_BASE/Catalina/localhost/ROOT.xml

HTH,

Mark

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