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



mod_alias equivalent for tomcat 8?

2017-09-08 Thread Chris Cheshire
In tomcat8, how do I go about configuring a Resources element to
replace mod_alias directives in httpd?


Currently my mod_alias config for httpd has

AliasMatch ^/images/(.*)$ /var/cdn/sandbox1/images/$1
AliasMatch ^/(.*)/images/(.*)$ /var/cdn/sandbox1-$1/images/$2

Order allow,deny
Allow from all



inside a virtualhost.


Now mod_jk config is now just

JkMount  /* sandbox1

to send everything to tomcat (I was unmounting /images otherwise to
get mod_alias to do its thing).

I have tried all kinds of variations of

  

  


in my context.xml and I get nothing but 404s from tomcat.


What is the difference between FileResourceSet and DirResourceSet? The
documentation explains JarResourceSet and ignores the other two. Even
the javadocs don't say much that would lead to me use over the other.

I tried to configure logging by adding

org.apache.catalina.webresources.level = FINEST

to logging.properties but nothing appears in catalina.out (yes I
restarted tomcat). I am utterly clueless when it comes to juli, I've
been using log4j and logback since dinosaurs roamed the earth.

Thanks

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