You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Victor Rodriguez <vi...@gmail.com> on 2016/12/08 21:59:46 UTC

URGENT: Tomcat 7 Aliases

THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just emphasizing!)

I have abc.war and I want both /abc and /xyz to work for it.  I've tried
adding aliases="/abc=abc.war,/xyz=abc.war" and aliases="/abc=abc,/xyz=abc"
but neither of those worked.  This is how my original context.xml looked
like.

<Context override="true" swallowOutput="true">
    <!-- Doing swallowOutput=true to allow each web applications System.out
and System.err calls
         to end up in a separate log, not in catalina.out.
         See Jira CA-4589
     -->
    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
   <!-- Disable session persistence across Tomcat restarts by including
this line; no sessions used for many OGC implemenations-->
    <Manager pathname="" />

    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve
className="org.apache.catalina.valves.CometConnectionManagerValve" />
    -->

</Context>

Re: URGENT: Tomcat 7 Aliases

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Victor,

On 12/9/16 11:40 AM, Victor Rodriguez wrote:
> Being able to have xyz as an alias for abc would be great, but
> everything I've tried with aliases hasn't worked either.
> 
> On Fri, Dec 9, 2016 at 8:28 AM, Victor Rodriguez
> <vi...@gmail.com> wrote:
> 
>> Chris, I really don't want double deployment.  I'm trying to have
>> a single abc.war and avoid having to install apache to
>> redirect/rewrite http://host:8082/xyz to http://host:8082/abc.  I
>> was hoping there was a way to have tomcat send /xyz to abc.war.
>> I suppose I could also just copy abc.war to xyz.war and have both
>> in the webapps directory, but I'm trying to avoid that.
>> 
>> On Fri, Dec 9, 2016 at 8:23 AM, Christopher Schultz < 
>> chris@christopherschultz.net> wrote:
>> 
> Victor,
> 
> On 12/9/16 11:17 AM, Victor Rodriguez wrote:
>>>>> Chris, a little more progress this morning...
>>>>> 
>>>>> This is what I currently have in my xyz.xml
>>>>> 
>>>>> <Context override="true" swallowOutput="true" 
>>>>> docBase="wfsservice.war">
>>>>> 
>>>>> And, this is what I get in my catalina.out...
>>>>> 
>>>>> INFO: Deploying configuration descriptor 
>>>>> /dg/local/cots/tomcat/tomcat_8082/conf/Catalina/localhost/xyz.xml
>>>>>
>>>>>
>>>>> 
...then...
>>>>> 
>>>>> WARNING: A docBase 
>>>>> /dg/local/cots/tomcat/tomcat_8082/webapps/abc.war inside
>>>>> the host appBase has been specified, and will be ignored
> 
> Aah, yes. This is probably because specifying a docBase inside the 
> appBase usually indicates a mistake that will result in 
> double-deployment of a web application. But double-deployment is 
> precicely what you are requesting.
> 
> We'll need to do this then:
> 
> 1. Put abc.war somewhere else 2. Change the path in xyz.xml to
> match #1 3. Copy xyz.xml to abc.xml in the same directory 4.
> Profit
> 
>>>>> ...then...
>>>>> 
>>>>> SEVERE: Error starting static Resources
>>>>> 
>>>>> java.lang.IllegalArgumentException: Document base 
>>>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not
>>>>> exist or is not a readable directory
>>>>> 
>>>>> So, it looks like it's looking for an exploded xyz
>>>>> directory.
> 
> It might be. But there isn't a stack trace so I have no idea if
> that is even being produced by Tomcat.
> 
> -chris
> 
>>>>> On Fri, Dec 9, 2016 at 8:07 AM, Christopher Schultz < 
>>>>> chris@christopherschultz.net> wrote:
>>>>> 
>>>>> Victor,
>>>>> 
>>>>> On 12/8/16 7:57 PM, Victor Rodriguez wrote:
>>>>>>>> On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz
>>>>>>>> < chris@christopherschultz.net> wrote:
>>>>>>>> 
>>>>>>>>> Victor,
>>>>>>>>> 
>>>>>>>>> On 12/8/16 4:59 PM, Victor Rodriguez wrote:
>>>>>>>>>>>> THANKS IN ADVANCE FOR YOUR HELP!  (not
>>>>>>>>>>>> yelling, just emphasizing!)
>>>>>>>>>>>> 
>>>>>>>>>>>> I have abc.war and I want both /abc and /xyz
>>>>>>>>>>>> to work for it.  I've tried adding 
>>>>>>>>>>>> aliases="/abc=abc.war,/xyz=abc.war" and 
>>>>>>>>>>>> aliases="/abc=abc,/xyz=abc" but neither of
>>>>>>>>>>>> those worked.  This is how my original
>>>>>>>>>>>> context.xml looked like.
>>>>>>>>>>>> 
>>>>>>>>>>>> <Context override="true"
>>>>>>>>>>>> swallowOutput="true"> <!-- Doing
>>>>>>>>>>>> swallowOutput=true to allow each web 
>>>>>>>>>>>> applications System.out and System.err calls
>>>>>>>>>>>> to end up in a separate log, not in
>>>>>>>>>>>> catalina.out. See Jira CA-4589 --> <!--
>>>>>>>>>>>> Default set of monitored resources --> 
>>>>>>>>>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>>>>>>>>>>>>
>>>>>>>>>>>> 
<!-- Disable session persistence across Tomcat
>>>>>>>>>>>> restarts by including this line; no sessions
>>>>>>>>>>>> used for many OGC implemenations--> <Manager
>>>>>>>>>>>> pathname="" />
>>>>>>>>>>>> 
>>>>>>>>>>>> <!-- Uncomment this to enable Comet
>>>>>>>>>>>> connection tacking (provides events on
>>>>>>>>>>>> session expiration as well as webapp
>>>>>>>>>>>> lifecycle) --> <!-- <Valve 
>>>>>>>>>>>> className="org.apache.catalina.valves.CometConnectionManage
rVal
>
>>>>>>>>>>>> 
ve"
>>>>>>>>>>>> 
>>>>>>>>>>>> 
>>>>> 
>>>>>>>>>>>> 
> /> -->
>>>>>>>>>>>> 
>>>>>>>>>>>> </Context>
>>>>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Tomcat 7 aliases are intended to map URLs within a
>>>>>>>>> single web application. You can't use it to
>>>>>>>>> duplicate the web application on two base paths.
>>>>>>>>> 
>>>>>>>>> Here's what you need to do:
>>>>>>>>> 
>>>>>>>>> 1. Put your WAR file in webapps/abc.war. This will
>>>>>>>>> deploy as usual.
>>>>>>>>> 
>>>>>>>>> 2. Copy webapps/abc.war/META-INF/context.xml into 
>>>>>>>>> conf/Catalina/localhost/xyz.xml and modify the
>>>>>>>>> <Context> element like this:
>>>>>>>>> 
>>>>>>>>> <Context override="true" swallowOutput="true" 
>>>>>>>>> docBase="webapps/abc.war "> ... </Context>
>>>>>>>> 
>>>>>>>> Thanks Chris!  I now get "Document base 
>>>>>>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does
>>>>>>>> not exist or is not a readable directory"
>>>>> 
>>>>> Is that path correct? What is the stack trace of that
>>>>> error?
>>>>> 
>>>>> I would have expected the path to be pointing to abc.war,
>>>>> not .../xyz
>>>>> 
>>>>> -chris

You will have to use re-writing to do this, and you'll have to use a
REDIRECT. You can't simply alias one web application for another. You
can double-deploy, but there really isn't any other good way to do this.

What's your use-case, here, anyway?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYSu7TAAoJEBzwKT+lPKRYOjYP/3VUKDP1gZ7Vrijkl+WAOM6N
IHW/2h8WdtpO4MCeXe0E0SoFI5GTGFOjFLoRiyBMTzXcS0RebWdD7ociqOflEn/z
GWKAgLbZXPvkXB29Y4xt8n030g8GQMAZYreb9YixKNXcVGk5cdaOXvlfArFSzrct
UBEjCXqvEjio9MT91W0GC4WkTpwkKyKLLstoDSAKfZ97SiAsPaVbzRh+Epjfbc7r
M05PJp05mgPSuEwyndRw4a9sZ2BsETH/f5TOs5lLOl0tJcoXZk7nV9r7FK5yCrWZ
t3lhu/5MobyeDLwPlcy7qHV+bpr5QFfHRYfdMjtQ8ujyWZpv/2kJEejVQnOtXvXT
BSv7Tb+OmxjxYxpGioK5JesUhJp5JFkPL2H4qaiy4bIXqTtj2z2yWQsht71F4vBx
z4/5NXi3qLUSh3U1PIGBguN7qzbkG8F+hmFeCW+iJ3w+s6yzQMx5M3KHY29E1wpQ
A+A0/pUMa45nzxUhmCaOAVDuxVi8ffMiM0X1sERCo7U+l7o6kgK+zxwkEPzJ+ofy
gdM1oR5O/o3w8wuVWmXzhnDMCHO5HCKTK2dIkKi8lBWQUlf7BrrCuCZiDJaF//Ry
O2BXD98CC/dr5JiiR1Ox2qNXe1IwSSDJds6GO3rkGN43IjnFEdlJLkLhn66sF+5z
DxksGXkejqqERpinlC/E
=UH73
-----END PGP SIGNATURE-----

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


Re: URGENT: Tomcat 7 Aliases

Posted by Victor Rodriguez <vi...@gmail.com>.
Being able to have xyz as an alias for abc would be great, but everything
I've tried with aliases hasn't worked either.

On Fri, Dec 9, 2016 at 8:28 AM, Victor Rodriguez <vi...@gmail.com>
wrote:

> Chris, I really don't want double deployment.  I'm trying to have a single
> abc.war and avoid having to install apache to redirect/rewrite
> http://host:8082/xyz to http://host:8082/abc.  I was hoping there was a
> way to have tomcat send /xyz to abc.war.  I suppose I could also just copy
> abc.war to xyz.war and have both in the webapps directory, but I'm trying
> to avoid that.
>
> On Fri, Dec 9, 2016 at 8:23 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> Victor,
>>
>> On 12/9/16 11:17 AM, Victor Rodriguez wrote:
>> > Chris, a little more progress this morning...
>> >
>> > This is what I currently have in my xyz.xml
>> >
>> > <Context override="true" swallowOutput="true"
>> > docBase="wfsservice.war">
>> >
>> > And, this is what I get in my catalina.out...
>> >
>> > INFO: Deploying configuration descriptor
>> > /dg/local/cots/tomcat/tomcat_8082/conf/Catalina/localhost/xyz.xml
>> >
>> > ...then...
>> >
>> > WARNING: A docBase
>> > /dg/local/cots/tomcat/tomcat_8082/webapps/abc.war inside the host
>> > appBase has been specified, and will be ignored
>>
>> Aah, yes. This is probably because specifying a docBase inside the
>> appBase usually indicates a mistake that will result in
>> double-deployment of a web application. But double-deployment is
>> precicely what you are requesting.
>>
>> We'll need to do this then:
>>
>> 1. Put abc.war somewhere else
>> 2. Change the path in xyz.xml to match #1
>> 3. Copy xyz.xml to abc.xml in the same directory
>> 4. Profit
>>
>> > ...then...
>> >
>> > SEVERE: Error starting static Resources
>> >
>> > java.lang.IllegalArgumentException: Document base
>> > /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is
>> > not a readable directory
>> >
>> > So, it looks like it's looking for an exploded xyz directory.
>>
>> It might be. But there isn't a stack trace so I have no idea if that
>> is even being produced by Tomcat.
>>
>> - -chris
>>
>> > On Fri, Dec 9, 2016 at 8:07 AM, Christopher Schultz <
>> > chris@christopherschultz.net> wrote:
>> >
>> > Victor,
>> >
>> > On 12/8/16 7:57 PM, Victor Rodriguez wrote:
>> >>>> On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz <
>> >>>> chris@christopherschultz.net> wrote:
>> >>>>
>> >>>>> Victor,
>> >>>>>
>> >>>>> On 12/8/16 4:59 PM, Victor Rodriguez wrote:
>> >>>>>>>> THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just
>> >>>>>>>> emphasizing!)
>> >>>>>>>>
>> >>>>>>>> I have abc.war and I want both /abc and /xyz to work
>> >>>>>>>> for it.  I've tried adding
>> >>>>>>>> aliases="/abc=abc.war,/xyz=abc.war" and
>> >>>>>>>> aliases="/abc=abc,/xyz=abc" but neither of those
>> >>>>>>>> worked.  This is how my original context.xml looked
>> >>>>>>>> like.
>> >>>>>>>>
>> >>>>>>>> <Context override="true" swallowOutput="true"> <!--
>> >>>>>>>> Doing swallowOutput=true to allow each web
>> >>>>>>>> applications System.out and System.err calls to end
>> >>>>>>>> up in a separate log, not in catalina.out. See Jira
>> >>>>>>>> CA-4589 --> <!-- Default set of monitored resources
>> >>>>>>>> -->
>> >>>>>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>> >>>>>>>> <!-- Disable session persistence across Tomcat
>> >>>>>>>> restarts by including this line; no sessions used for
>> >>>>>>>> many OGC implemenations--> <Manager pathname="" />
>> >>>>>>>>
>> >>>>>>>> <!-- Uncomment this to enable Comet connection
>> >>>>>>>> tacking (provides events on session expiration as
>> >>>>>>>> well as webapp lifecycle) --> <!-- <Valve
>> >>>>>>>> className="org.apache.catalina.valves.CometConnectionManagerVal
>> ve"
>> >>>>>>>>
>> >>>>>>>>
>> >
>> >>>>>>>>
>> /> -->
>> >>>>>>>>
>> >>>>>>>> </Context>
>> >>>>>>>>
>> >>>>>
>> >>>>> Tomcat 7 aliases are intended to map URLs within a single
>> >>>>> web application. You can't use it to duplicate the web
>> >>>>> application on two base paths.
>> >>>>>
>> >>>>> Here's what you need to do:
>> >>>>>
>> >>>>> 1. Put your WAR file in webapps/abc.war. This will deploy
>> >>>>> as usual.
>> >>>>>
>> >>>>> 2. Copy webapps/abc.war/META-INF/context.xml into
>> >>>>> conf/Catalina/localhost/xyz.xml and modify the <Context>
>> >>>>> element like this:
>> >>>>>
>> >>>>> <Context override="true" swallowOutput="true"
>> >>>>> docBase="webapps/abc.war "> ... </Context>
>> >>>>
>> >>>> Thanks Chris!  I now get "Document base
>> >>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist
>> >>>> or is not a readable directory"
>> >
>> > Is that path correct? What is the stack trace of that error?
>> >
>> > I would have expected the path to be pointing to abc.war, not
>> > .../xyz
>> >
>> > -chris
>> >>
>> >> ---------------------------------------------------------------------
>> >>
>> >>
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> >> For additional commands, e-mail: users-help@tomcat.apache.org
>> >>
>> >>
>> >
>> >
>> -----BEGIN PGP SIGNATURE-----
>> Comment: GPGTools - http://gpgtools.org
>> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>>
>> iQIcBAEBCAAGBQJYStqTAAoJEBzwKT+lPKRYHakP/1ElYsYhiwGr/WUS8LvYxGwY
>> OtTGFKWwuUetcXhPNHnXmH3cnJcME44bjQyLDqXCKgKiCHaJ6aV+p+F/vlaFL5no
>> T6vu1lk5BUA/uMgryyg766EWoDeQZTlp/SKYpPwJfrdmYr36pqkOC93aoZIBB1QF
>> /vWOByQIhVFvWM7e/7GxJo5tG0StGWLaM16zj88r+lhkV37UweavovStjNIjIWrC
>> W7ihnlHV5QeW1rKFQ+rmD7BVRY0up5P8Be8FUrNrIFheXq7+JQBNRtM2YRIcSwTM
>> TzbUr+n8MOAzIths6HZ9vnddXSE61Ndqku8FPZ/CMSYkPCIgK+x8btQ/4lb2zqDK
>> aUQac0lOeQQMK9POXpp65O+45yVQkyJeTScgAjikngRdn0x9VQTxHa4WggSgFPxX
>> vZik/3s5QvzjlGlArk7+71r/mmszOc+g2s+vN7aBDTDiGgHJOtStp1SbmkgW9w7m
>> sW+dSgR/78BRFZSXRsRdBf3RkQzCFk/dAJr8flEYKWFF7s0TOmrMSuxX7NB3EzK+
>> 9tcce1xSb1TXRq/h/x59Mjidntl5qo7g123QWgwe4z7tqfOMbj30zYDwWjIJTzDt
>> hq5zM1qxgH/mAUtiwdK/Ezb7CcOPMj5VokGu7ptKB9PrxqtLLZ9EbfrbB2sicbZ4
>> gAXhoj65+cdeL322fnMj
>> =yBjR
>> -----END PGP SIGNATURE-----
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> --
> Sent from neither my iPhone nor my iPad.
>



-- 
Sent from neither my iPhone nor my iPad.

Re: URGENT: Tomcat 7 Aliases

Posted by Mark Eggers <it...@yahoo.com.INVALID>.
Victor,

Please do not top post.

Anyway (see at the bottom).


On 12/9/2016 8:28 AM, Victor Rodriguez wrote:
> Chris, I really don't want double deployment.  I'm trying to have a single
> abc.war and avoid having to install apache to redirect/rewrite
> http://host:8082/xyz to http://host:8082/abc.  I was hoping there was a way
> to have tomcat send /xyz to abc.war.  I suppose I could also just copy
> abc.war to xyz.war and have both in the webapps directory, but I'm trying
> to avoid that.
> 
> On Fri, Dec 9, 2016 at 8:23 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
> 
> Victor,
> 
> On 12/9/16 11:17 AM, Victor Rodriguez wrote:
>>>> Chris, a little more progress this morning...
>>>>
>>>> This is what I currently have in my xyz.xml
>>>>
>>>> <Context override="true" swallowOutput="true"
>>>> docBase="wfsservice.war">
>>>>
>>>> And, this is what I get in my catalina.out...
>>>>
>>>> INFO: Deploying configuration descriptor
>>>> /dg/local/cots/tomcat/tomcat_8082/conf/Catalina/localhost/xyz.xml
>>>>
>>>> ...then...
>>>>
>>>> WARNING: A docBase
>>>> /dg/local/cots/tomcat/tomcat_8082/webapps/abc.war inside the host
>>>> appBase has been specified, and will be ignored
> 
> Aah, yes. This is probably because specifying a docBase inside the
> appBase usually indicates a mistake that will result in
> double-deployment of a web application. But double-deployment is
> precicely what you are requesting.
> 
> We'll need to do this then:
> 
> 1. Put abc.war somewhere else
> 2. Change the path in xyz.xml to match #1
> 3. Copy xyz.xml to abc.xml in the same directory
> 4. Profit
> 
>>>> ...then...
>>>>
>>>> SEVERE: Error starting static Resources
>>>>
>>>> java.lang.IllegalArgumentException: Document base
>>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is
>>>> not a readable directory
>>>>
>>>> So, it looks like it's looking for an exploded xyz directory.
> 
> It might be. But there isn't a stack trace so I have no idea if that
> is even being produced by Tomcat.
> 
> -chris
> 
>>>> On Fri, Dec 9, 2016 at 8:07 AM, Christopher Schultz <
>>>> chris@christopherschultz.net> wrote:
>>>>
>>>> Victor,
>>>>
>>>> On 12/8/16 7:57 PM, Victor Rodriguez wrote:
>>>>>>> On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz <
>>>>>>> chris@christopherschultz.net> wrote:
>>>>>>>
>>>>>>>> Victor,
>>>>>>>>
>>>>>>>> On 12/8/16 4:59 PM, Victor Rodriguez wrote:
>>>>>>>>>>> THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just
>>>>>>>>>>> emphasizing!)
>>>>>>>>>>>
>>>>>>>>>>> I have abc.war and I want both /abc and /xyz to work
>>>>>>>>>>> for it.  I've tried adding
>>>>>>>>>>> aliases="/abc=abc.war,/xyz=abc.war" and
>>>>>>>>>>> aliases="/abc=abc,/xyz=abc" but neither of those
>>>>>>>>>>> worked.  This is how my original context.xml looked
>>>>>>>>>>> like.
>>>>>>>>>>>
>>>>>>>>>>> <Context override="true" swallowOutput="true"> <!--
>>>>>>>>>>> Doing swallowOutput=true to allow each web
>>>>>>>>>>> applications System.out and System.err calls to end
>>>>>>>>>>> up in a separate log, not in catalina.out. See Jira
>>>>>>>>>>> CA-4589 --> <!-- Default set of monitored resources
>>>>>>>>>>> -->
>>>>>>>>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>>>>>>>>>>> <!-- Disable session persistence across Tomcat
>>>>>>>>>>> restarts by including this line; no sessions used for
>>>>>>>>>>> many OGC implemenations--> <Manager pathname="" />
>>>>>>>>>>>
>>>>>>>>>>> <!-- Uncomment this to enable Comet connection
>>>>>>>>>>> tacking (provides events on session expiration as
>>>>>>>>>>> well as webapp lifecycle) --> <!-- <Valve
>>>>>>>>>>> className="org.apache.catalina.valves.CometConnectionManagerVal
> ve"
>>>>>>>>>>>
>>>>>>>>>>>
>>>>
>>>>>>>>>>>
> /> -->
>>>>>>>>>>>
>>>>>>>>>>> </Context>
>>>>>>>>>>>
>>>>>>>>
>>>>>>>> Tomcat 7 aliases are intended to map URLs within a single
>>>>>>>> web application. You can't use it to duplicate the web
>>>>>>>> application on two base paths.
>>>>>>>>
>>>>>>>> Here's what you need to do:
>>>>>>>>
>>>>>>>> 1. Put your WAR file in webapps/abc.war. This will deploy
>>>>>>>> as usual.
>>>>>>>>
>>>>>>>> 2. Copy webapps/abc.war/META-INF/context.xml into
>>>>>>>> conf/Catalina/localhost/xyz.xml and modify the <Context>
>>>>>>>> element like this:
>>>>>>>>
>>>>>>>> <Context override="true" swallowOutput="true"
>>>>>>>> docBase="webapps/abc.war "> ... </Context>
>>>>>>>
>>>>>>> Thanks Chris!  I now get "Document base
>>>>>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist
>>>>>>> or is not a readable directory"
>>>>
>>>> Is that path correct? What is the stack trace of that error?
>>>>
>>>> I would have expected the path to be pointing to abc.war, not
>>>> .../xyz
>>>>
>>>> -chris

What Chris is saying is the following:

Suppose the user you're running Tomcat under is called tomcat, with a
home directory of /home/tomcat.

Make a directory under /home/tomcat - call it Apps (probably too
generic, but you get the idea).

Now copy abc.war into that directory.

Then you'll create two context.xml files.

Call one abc.xml

Call the other xyz.xml

In both abc.xml and xyz.xml, specify the complete path to abc.war as the
docBase - like this (using the layout above)

<Context docBase="/home/tomcat/Apps/abc.war">
<!-- any other stuff -->
</Context>

Now copy both of these xml files to

$CATALINA_BASE/conf/Catalina/localhost/

More properly:

$CATALINA_BASE/conf/[Engine name]/[Host name]/

where [Engine name] is the name attribute from the Engine element in
server.xml, and Host name is the name attribute from the Host element in
server.xml.

I haven't tried this, but I don't see why it shouldn't work.

The basis for this can be found here:

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

. . . just my two cents (and no coffee)
/mde/


Re: URGENT: Tomcat 7 Aliases

Posted by Victor Rodriguez <vi...@gmail.com>.
Chris, I really don't want double deployment.  I'm trying to have a single
abc.war and avoid having to install apache to redirect/rewrite
http://host:8082/xyz to http://host:8082/abc.  I was hoping there was a way
to have tomcat send /xyz to abc.war.  I suppose I could also just copy
abc.war to xyz.war and have both in the webapps directory, but I'm trying
to avoid that.

On Fri, Dec 9, 2016 at 8:23 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Victor,
>
> On 12/9/16 11:17 AM, Victor Rodriguez wrote:
> > Chris, a little more progress this morning...
> >
> > This is what I currently have in my xyz.xml
> >
> > <Context override="true" swallowOutput="true"
> > docBase="wfsservice.war">
> >
> > And, this is what I get in my catalina.out...
> >
> > INFO: Deploying configuration descriptor
> > /dg/local/cots/tomcat/tomcat_8082/conf/Catalina/localhost/xyz.xml
> >
> > ...then...
> >
> > WARNING: A docBase
> > /dg/local/cots/tomcat/tomcat_8082/webapps/abc.war inside the host
> > appBase has been specified, and will be ignored
>
> Aah, yes. This is probably because specifying a docBase inside the
> appBase usually indicates a mistake that will result in
> double-deployment of a web application. But double-deployment is
> precicely what you are requesting.
>
> We'll need to do this then:
>
> 1. Put abc.war somewhere else
> 2. Change the path in xyz.xml to match #1
> 3. Copy xyz.xml to abc.xml in the same directory
> 4. Profit
>
> > ...then...
> >
> > SEVERE: Error starting static Resources
> >
> > java.lang.IllegalArgumentException: Document base
> > /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is
> > not a readable directory
> >
> > So, it looks like it's looking for an exploded xyz directory.
>
> It might be. But there isn't a stack trace so I have no idea if that
> is even being produced by Tomcat.
>
> - -chris
>
> > On Fri, Dec 9, 2016 at 8:07 AM, Christopher Schultz <
> > chris@christopherschultz.net> wrote:
> >
> > Victor,
> >
> > On 12/8/16 7:57 PM, Victor Rodriguez wrote:
> >>>> On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz <
> >>>> chris@christopherschultz.net> wrote:
> >>>>
> >>>>> Victor,
> >>>>>
> >>>>> On 12/8/16 4:59 PM, Victor Rodriguez wrote:
> >>>>>>>> THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just
> >>>>>>>> emphasizing!)
> >>>>>>>>
> >>>>>>>> I have abc.war and I want both /abc and /xyz to work
> >>>>>>>> for it.  I've tried adding
> >>>>>>>> aliases="/abc=abc.war,/xyz=abc.war" and
> >>>>>>>> aliases="/abc=abc,/xyz=abc" but neither of those
> >>>>>>>> worked.  This is how my original context.xml looked
> >>>>>>>> like.
> >>>>>>>>
> >>>>>>>> <Context override="true" swallowOutput="true"> <!--
> >>>>>>>> Doing swallowOutput=true to allow each web
> >>>>>>>> applications System.out and System.err calls to end
> >>>>>>>> up in a separate log, not in catalina.out. See Jira
> >>>>>>>> CA-4589 --> <!-- Default set of monitored resources
> >>>>>>>> -->
> >>>>>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
> >>>>>>>> <!-- Disable session persistence across Tomcat
> >>>>>>>> restarts by including this line; no sessions used for
> >>>>>>>> many OGC implemenations--> <Manager pathname="" />
> >>>>>>>>
> >>>>>>>> <!-- Uncomment this to enable Comet connection
> >>>>>>>> tacking (provides events on session expiration as
> >>>>>>>> well as webapp lifecycle) --> <!-- <Valve
> >>>>>>>> className="org.apache.catalina.valves.CometConnectionManagerVal
> ve"
> >>>>>>>>
> >>>>>>>>
> >
> >>>>>>>>
> /> -->
> >>>>>>>>
> >>>>>>>> </Context>
> >>>>>>>>
> >>>>>
> >>>>> Tomcat 7 aliases are intended to map URLs within a single
> >>>>> web application. You can't use it to duplicate the web
> >>>>> application on two base paths.
> >>>>>
> >>>>> Here's what you need to do:
> >>>>>
> >>>>> 1. Put your WAR file in webapps/abc.war. This will deploy
> >>>>> as usual.
> >>>>>
> >>>>> 2. Copy webapps/abc.war/META-INF/context.xml into
> >>>>> conf/Catalina/localhost/xyz.xml and modify the <Context>
> >>>>> element like this:
> >>>>>
> >>>>> <Context override="true" swallowOutput="true"
> >>>>> docBase="webapps/abc.war "> ... </Context>
> >>>>
> >>>> Thanks Chris!  I now get "Document base
> >>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist
> >>>> or is not a readable directory"
> >
> > Is that path correct? What is the stack trace of that error?
> >
> > I would have expected the path to be pointing to abc.war, not
> > .../xyz
> >
> > -chris
> >>
> >> ---------------------------------------------------------------------
> >>
> >>
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
> >
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJYStqTAAoJEBzwKT+lPKRYHakP/1ElYsYhiwGr/WUS8LvYxGwY
> OtTGFKWwuUetcXhPNHnXmH3cnJcME44bjQyLDqXCKgKiCHaJ6aV+p+F/vlaFL5no
> T6vu1lk5BUA/uMgryyg766EWoDeQZTlp/SKYpPwJfrdmYr36pqkOC93aoZIBB1QF
> /vWOByQIhVFvWM7e/7GxJo5tG0StGWLaM16zj88r+lhkV37UweavovStjNIjIWrC
> W7ihnlHV5QeW1rKFQ+rmD7BVRY0up5P8Be8FUrNrIFheXq7+JQBNRtM2YRIcSwTM
> TzbUr+n8MOAzIths6HZ9vnddXSE61Ndqku8FPZ/CMSYkPCIgK+x8btQ/4lb2zqDK
> aUQac0lOeQQMK9POXpp65O+45yVQkyJeTScgAjikngRdn0x9VQTxHa4WggSgFPxX
> vZik/3s5QvzjlGlArk7+71r/mmszOc+g2s+vN7aBDTDiGgHJOtStp1SbmkgW9w7m
> sW+dSgR/78BRFZSXRsRdBf3RkQzCFk/dAJr8flEYKWFF7s0TOmrMSuxX7NB3EzK+
> 9tcce1xSb1TXRq/h/x59Mjidntl5qo7g123QWgwe4z7tqfOMbj30zYDwWjIJTzDt
> hq5zM1qxgH/mAUtiwdK/Ezb7CcOPMj5VokGu7ptKB9PrxqtLLZ9EbfrbB2sicbZ4
> gAXhoj65+cdeL322fnMj
> =yBjR
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sent from neither my iPhone nor my iPad.

Re: URGENT: Tomcat 7 Aliases

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Victor,

On 12/9/16 11:17 AM, Victor Rodriguez wrote:
> Chris, a little more progress this morning...
> 
> This is what I currently have in my xyz.xml
> 
> <Context override="true" swallowOutput="true"
> docBase="wfsservice.war">
> 
> And, this is what I get in my catalina.out...
> 
> INFO: Deploying configuration descriptor 
> /dg/local/cots/tomcat/tomcat_8082/conf/Catalina/localhost/xyz.xml
> 
> ...then...
> 
> WARNING: A docBase
> /dg/local/cots/tomcat/tomcat_8082/webapps/abc.war inside the host
> appBase has been specified, and will be ignored

Aah, yes. This is probably because specifying a docBase inside the
appBase usually indicates a mistake that will result in
double-deployment of a web application. But double-deployment is
precicely what you are requesting.

We'll need to do this then:

1. Put abc.war somewhere else
2. Change the path in xyz.xml to match #1
3. Copy xyz.xml to abc.xml in the same directory
4. Profit

> ...then...
> 
> SEVERE: Error starting static Resources
> 
> java.lang.IllegalArgumentException: Document base 
> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is
> not a readable directory
> 
> So, it looks like it's looking for an exploded xyz directory.

It might be. But there isn't a stack trace so I have no idea if that
is even being produced by Tomcat.

- -chris

> On Fri, Dec 9, 2016 at 8:07 AM, Christopher Schultz < 
> chris@christopherschultz.net> wrote:
> 
> Victor,
> 
> On 12/8/16 7:57 PM, Victor Rodriguez wrote:
>>>> On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz < 
>>>> chris@christopherschultz.net> wrote:
>>>> 
>>>>> Victor,
>>>>> 
>>>>> On 12/8/16 4:59 PM, Victor Rodriguez wrote:
>>>>>>>> THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just 
>>>>>>>> emphasizing!)
>>>>>>>> 
>>>>>>>> I have abc.war and I want both /abc and /xyz to work
>>>>>>>> for it.  I've tried adding
>>>>>>>> aliases="/abc=abc.war,/xyz=abc.war" and
>>>>>>>> aliases="/abc=abc,/xyz=abc" but neither of those 
>>>>>>>> worked.  This is how my original context.xml looked
>>>>>>>> like.
>>>>>>>> 
>>>>>>>> <Context override="true" swallowOutput="true"> <!--
>>>>>>>> Doing swallowOutput=true to allow each web
>>>>>>>> applications System.out and System.err calls to end
>>>>>>>> up in a separate log, not in catalina.out. See Jira
>>>>>>>> CA-4589 --> <!-- Default set of monitored resources
>>>>>>>> --> 
>>>>>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource>
>>>>>>>> <!-- Disable session persistence across Tomcat
>>>>>>>> restarts by including this line; no sessions used for
>>>>>>>> many OGC implemenations--> <Manager pathname="" />
>>>>>>>> 
>>>>>>>> <!-- Uncomment this to enable Comet connection
>>>>>>>> tacking (provides events on session expiration as
>>>>>>>> well as webapp lifecycle) --> <!-- <Valve 
>>>>>>>> className="org.apache.catalina.valves.CometConnectionManagerVal
ve"
>>>>>>>>
>>>>>>>>
>
>>>>>>>> 
/> -->
>>>>>>>> 
>>>>>>>> </Context>
>>>>>>>> 
>>>>> 
>>>>> Tomcat 7 aliases are intended to map URLs within a single
>>>>> web application. You can't use it to duplicate the web
>>>>> application on two base paths.
>>>>> 
>>>>> Here's what you need to do:
>>>>> 
>>>>> 1. Put your WAR file in webapps/abc.war. This will deploy
>>>>> as usual.
>>>>> 
>>>>> 2. Copy webapps/abc.war/META-INF/context.xml into 
>>>>> conf/Catalina/localhost/xyz.xml and modify the <Context>
>>>>> element like this:
>>>>> 
>>>>> <Context override="true" swallowOutput="true" 
>>>>> docBase="webapps/abc.war "> ... </Context>
>>>> 
>>>> Thanks Chris!  I now get "Document base 
>>>> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist
>>>> or is not a readable directory"
> 
> Is that path correct? What is the stack trace of that error?
> 
> I would have expected the path to be pointing to abc.war, not
> .../xyz
> 
> -chris
>> 
>> ---------------------------------------------------------------------
>>
>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
>> 
> 
> 
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYStqTAAoJEBzwKT+lPKRYHakP/1ElYsYhiwGr/WUS8LvYxGwY
OtTGFKWwuUetcXhPNHnXmH3cnJcME44bjQyLDqXCKgKiCHaJ6aV+p+F/vlaFL5no
T6vu1lk5BUA/uMgryyg766EWoDeQZTlp/SKYpPwJfrdmYr36pqkOC93aoZIBB1QF
/vWOByQIhVFvWM7e/7GxJo5tG0StGWLaM16zj88r+lhkV37UweavovStjNIjIWrC
W7ihnlHV5QeW1rKFQ+rmD7BVRY0up5P8Be8FUrNrIFheXq7+JQBNRtM2YRIcSwTM
TzbUr+n8MOAzIths6HZ9vnddXSE61Ndqku8FPZ/CMSYkPCIgK+x8btQ/4lb2zqDK
aUQac0lOeQQMK9POXpp65O+45yVQkyJeTScgAjikngRdn0x9VQTxHa4WggSgFPxX
vZik/3s5QvzjlGlArk7+71r/mmszOc+g2s+vN7aBDTDiGgHJOtStp1SbmkgW9w7m
sW+dSgR/78BRFZSXRsRdBf3RkQzCFk/dAJr8flEYKWFF7s0TOmrMSuxX7NB3EzK+
9tcce1xSb1TXRq/h/x59Mjidntl5qo7g123QWgwe4z7tqfOMbj30zYDwWjIJTzDt
hq5zM1qxgH/mAUtiwdK/Ezb7CcOPMj5VokGu7ptKB9PrxqtLLZ9EbfrbB2sicbZ4
gAXhoj65+cdeL322fnMj
=yBjR
-----END PGP SIGNATURE-----

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


Re: URGENT: Tomcat 7 Aliases

Posted by Victor Rodriguez <vi...@gmail.com>.
Chris, a little more progress this morning...

This is what I currently have in my xyz.xml

<Context override="true" swallowOutput="true" docBase="wfsservice.war">

And, this is what I get in my catalina.out...

INFO: Deploying configuration descriptor
/dg/local/cots/tomcat/tomcat_8082/conf/Catalina/localhost/xyz.xml

...then...

WARNING: A docBase /dg/local/cots/tomcat/tomcat_8082/webapps/abc.war inside
the host appBase has been specified, and will be ignored

...then...

SEVERE: Error starting static Resources

java.lang.IllegalArgumentException: Document base
/dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is not a
readable directory

So, it looks like it's looking for an exploded xyz directory.

On Fri, Dec 9, 2016 at 8:07 AM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Victor,
>
> On 12/8/16 7:57 PM, Victor Rodriguez wrote:
> > On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz <
> > chris@christopherschultz.net> wrote:
> >
> >> Victor,
> >>
> >> On 12/8/16 4:59 PM, Victor Rodriguez wrote:
> >>>>> THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just
> >>>>> emphasizing!)
> >>>>>
> >>>>> I have abc.war and I want both /abc and /xyz to work for
> >>>>> it.  I've tried adding aliases="/abc=abc.war,/xyz=abc.war"
> >>>>> and aliases="/abc=abc,/xyz=abc" but neither of those
> >>>>> worked.  This is how my original context.xml looked like.
> >>>>>
> >>>>> <Context override="true" swallowOutput="true"> <!-- Doing
> >>>>> swallowOutput=true to allow each web applications
> >>>>> System.out and System.err calls to end up in a separate
> >>>>> log, not in catalina.out. See Jira CA-4589 --> <!-- Default
> >>>>> set of monitored resources -->
> >>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource> <!--
> >>>>> Disable session persistence across Tomcat restarts by
> >>>>> including this line; no sessions used for many OGC
> >>>>> implemenations--> <Manager pathname="" />
> >>>>>
> >>>>> <!-- Uncomment this to enable Comet connection tacking
> >>>>> (provides events on session expiration as well as webapp
> >>>>> lifecycle) --> <!-- <Valve
> >>>>> className="org.apache.catalina.valves.CometConnectionManagerValve"
> >>>>>
> >>>>>
> /> -->
> >>>>>
> >>>>> </Context>
> >>>>>
> >>
> >> Tomcat 7 aliases are intended to map URLs within a single web
> >> application. You can't use it to duplicate the web application on
> >> two base paths.
> >>
> >> Here's what you need to do:
> >>
> >> 1. Put your WAR file in webapps/abc.war. This will deploy as
> >> usual.
> >>
> >> 2. Copy webapps/abc.war/META-INF/context.xml into
> >> conf/Catalina/localhost/xyz.xml and modify the <Context> element
> >> like this:
> >>
> >> <Context override="true" swallowOutput="true"
> >> docBase="webapps/abc.war "> ... </Context>
> >
> > Thanks Chris!  I now get "Document base
> > /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is
> > not a readable directory"
>
> Is that path correct? What is the stack trace of that error?
>
> I would have expected the path to be pointing to abc.war, not .../xyz
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJYStazAAoJEBzwKT+lPKRYPyEQAJZ8YpO/qzFtGkvZnR5Ws9CS
> jns81BMXXW01tPbTqEUVmGOnuTcDS/fTzaOtqp5QfkeAy9408vh8ynC1es2ZuKZ9
> iwlI9Rvwlg0LMiLIHOvmvTHEjxDEN6UCDtUb7iUc2IgVe3LCUm7wgAF6d84uhbIm
> +wi+HYd9ezl+KXfmr9izvfX3iFghdCS+MLR3OIusHhtlTzipmQVF6Vxrr7LcMv1F
> CR31oClB4XY6fFuzUmbLfV+O39ccHNGdb72fXcWAIFJNtjjLdQdpgw97O7J5BSRt
> Bmrk803NditwB0Zb99Fl39pf7+AMREkagnI1NHVuC0XwCOqNI0eHflPMEhJE9BUA
> Z3nlIUemi42lc8+IqXm+qIoZ67MG52UnUfOFcpc0g0tgO9YLRLJrhAsQY8E9QLQc
> kMPRD6GsFXFY38K9owX9znFPjR5FvCHdCdgln+emhCxGJt4MnyOs8I6U8ZCxyRSL
> gGSpTCmPYs0gx+6AaAhSpiy21E5LsFE1W5UdsEcBtjmy/XcFg+qJWn1OxThR8Iyj
> +24ooVNgmY6bR7HLNCUd7EE9baS1Fu0v2TWzN0Aw9E4gdGBr7TVNrI9lw4gXSHsv
> qtKRkQvSDmwNNmRUqFz//NIKlNGLSSYj4qa40pPux6ysNLRJ3mXudzq9bGKY73n1
> 9Y7HBzUnFlQj8NzP6kJM
> =Q+Vp
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sent from neither my iPhone nor my iPad.

Re: URGENT: Tomcat 7 Aliases

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Victor,

On 12/8/16 7:57 PM, Victor Rodriguez wrote:
> On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz < 
> chris@christopherschultz.net> wrote:
> 
>> Victor,
>> 
>> On 12/8/16 4:59 PM, Victor Rodriguez wrote:
>>>>> THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just
>>>>> emphasizing!)
>>>>> 
>>>>> I have abc.war and I want both /abc and /xyz to work for
>>>>> it.  I've tried adding aliases="/abc=abc.war,/xyz=abc.war"
>>>>> and aliases="/abc=abc,/xyz=abc" but neither of those
>>>>> worked.  This is how my original context.xml looked like.
>>>>> 
>>>>> <Context override="true" swallowOutput="true"> <!-- Doing 
>>>>> swallowOutput=true to allow each web applications
>>>>> System.out and System.err calls to end up in a separate
>>>>> log, not in catalina.out. See Jira CA-4589 --> <!-- Default
>>>>> set of monitored resources --> 
>>>>> <WatchedResource>WEB-INF/web.xml</WatchedResource> <!--
>>>>> Disable session persistence across Tomcat restarts by
>>>>> including this line; no sessions used for many OGC
>>>>> implemenations--> <Manager pathname="" />
>>>>> 
>>>>> <!-- Uncomment this to enable Comet connection tacking
>>>>> (provides events on session expiration as well as webapp
>>>>> lifecycle) --> <!-- <Valve 
>>>>> className="org.apache.catalina.valves.CometConnectionManagerValve"
>>>>>
>>>>> 
/> -->
>>>>> 
>>>>> </Context>
>>>>> 
>> 
>> Tomcat 7 aliases are intended to map URLs within a single web 
>> application. You can't use it to duplicate the web application on
>> two base paths.
>> 
>> Here's what you need to do:
>> 
>> 1. Put your WAR file in webapps/abc.war. This will deploy as
>> usual.
>> 
>> 2. Copy webapps/abc.war/META-INF/context.xml into 
>> conf/Catalina/localhost/xyz.xml and modify the <Context> element
>> like this:
>> 
>> <Context override="true" swallowOutput="true"
>> docBase="webapps/abc.war "> ... </Context>
> 
> Thanks Chris!  I now get "Document base 
> /dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is
> not a readable directory"

Is that path correct? What is the stack trace of that error?

I would have expected the path to be pointing to abc.war, not .../xyz

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYStazAAoJEBzwKT+lPKRYPyEQAJZ8YpO/qzFtGkvZnR5Ws9CS
jns81BMXXW01tPbTqEUVmGOnuTcDS/fTzaOtqp5QfkeAy9408vh8ynC1es2ZuKZ9
iwlI9Rvwlg0LMiLIHOvmvTHEjxDEN6UCDtUb7iUc2IgVe3LCUm7wgAF6d84uhbIm
+wi+HYd9ezl+KXfmr9izvfX3iFghdCS+MLR3OIusHhtlTzipmQVF6Vxrr7LcMv1F
CR31oClB4XY6fFuzUmbLfV+O39ccHNGdb72fXcWAIFJNtjjLdQdpgw97O7J5BSRt
Bmrk803NditwB0Zb99Fl39pf7+AMREkagnI1NHVuC0XwCOqNI0eHflPMEhJE9BUA
Z3nlIUemi42lc8+IqXm+qIoZ67MG52UnUfOFcpc0g0tgO9YLRLJrhAsQY8E9QLQc
kMPRD6GsFXFY38K9owX9znFPjR5FvCHdCdgln+emhCxGJt4MnyOs8I6U8ZCxyRSL
gGSpTCmPYs0gx+6AaAhSpiy21E5LsFE1W5UdsEcBtjmy/XcFg+qJWn1OxThR8Iyj
+24ooVNgmY6bR7HLNCUd7EE9baS1Fu0v2TWzN0Aw9E4gdGBr7TVNrI9lw4gXSHsv
qtKRkQvSDmwNNmRUqFz//NIKlNGLSSYj4qa40pPux6ysNLRJ3mXudzq9bGKY73n1
9Y7HBzUnFlQj8NzP6kJM
=Q+Vp
-----END PGP SIGNATURE-----

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


Re: URGENT: Tomcat 7 Aliases

Posted by Victor Rodriguez <vi...@gmail.com>.
Thanks Chris!  I now get "Document base
/dg/local/cots/tomcat/tomcat_8082/webapps/xyz does not exist or is not a
readable directory"

On Thu, Dec 8, 2016 at 2:50 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Victor,
>
> On 12/8/16 4:59 PM, Victor Rodriguez wrote:
> > THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just emphasizing!)
> >
> > I have abc.war and I want both /abc and /xyz to work for it.  I've
> > tried adding aliases="/abc=abc.war,/xyz=abc.war" and
> > aliases="/abc=abc,/xyz=abc" but neither of those worked.  This is
> > how my original context.xml looked like.
> >
> > <Context override="true" swallowOutput="true"> <!-- Doing
> > swallowOutput=true to allow each web applications System.out and
> > System.err calls to end up in a separate log, not in catalina.out.
> > See Jira CA-4589 --> <!-- Default set of monitored resources -->
> > <WatchedResource>WEB-INF/web.xml</WatchedResource> <!-- Disable
> > session persistence across Tomcat restarts by including this line;
> > no sessions used for many OGC implemenations--> <Manager
> > pathname="" />
> >
> > <!-- Uncomment this to enable Comet connection tacking (provides
> > events on session expiration as well as webapp lifecycle) --> <!--
> > <Valve
> > className="org.apache.catalina.valves.CometConnectionManagerValve"
> > /> -->
> >
> > </Context>
> >
>
> Tomcat 7 aliases are intended to map URLs within a single web
> application. You can't use it to duplicate the web application on two
> base paths.
>
> Here's what you need to do:
>
> 1. Put your WAR file in webapps/abc.war. This will deploy as usual.
>
> 2. Copy webapps/abc.war/META-INF/context.xml into
> conf/Catalina/localhost/xyz.xml and modify the <Context> element like
> this:
>
>   <Context override="true" swallowOutput="true" docBase="webapps/abc.war
> ">
>    ...
>   </Context>
>
> Hope that helps,
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJYSeO/AAoJEBzwKT+lPKRYBkIQAKiBaS7HNJrBfROGNu1pif1d
> ZPW1pyqXOp879TX9IjhViu8oSMQS1vymG4DrHscRUMlkdNuny+NHKecxKMv1La5i
> DtQOt2Hax26QizANh+cp9QHaJejdMpNM3mc4ySYfqi5bL4m3MlO7D+NycFT321/q
> mfKtDmH596B8TJRchoPjLCOl2jjPfvHSf2c1BVnztIOXXY/X4PwZfNiLv1uZDGnn
> pqK77m6TAiiMjV9lrn2DX7i3wZi1tiG13PoF16CYubmTNixbmZ45gO3dr+VmH+h2
> Q1hlN+MMghpbQ0Ukg1EYldA21ct31OjyG3ipinSHgTPygKV/ZvEIM3Zh67iU0bUn
> xOkiQ3G6nACSRP+0+9qFqnSGN283RQKC1eS6/ZnpG+YLOtNbh60+gLyOQk4O9/pw
> ZBabh7gOCjozHFmuDgcgec/Ql2kFS86fDBTX1QdjrhTdm/rH4rEAYShbL168gCC0
> vt+kjqR2QPJPkpxeuYiPTdoAI7eOLX1M4JfStF9Dmce5291262t2PJdBYJjulfVS
> cXVRjWgPCAiluBcyF2LME5E+jKEGeMtmBbK2+S8UVIXDS0MvKWLDln5PW8MAfWWr
> xfSFTBqNOKVtEuz22KpYkbljfXrLxn2uY6TKTjQnwddpH4t1TP0qSpnxCe38j3WT
> 3j37VFuqdMGl0f54yk12
> =hk95
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Sent from neither my iPhone nor my iPad.

Re: URGENT: Tomcat 7 Aliases

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Victor,

On 12/8/16 4:59 PM, Victor Rodriguez wrote:
> THANKS IN ADVANCE FOR YOUR HELP!  (not yelling, just emphasizing!)
> 
> I have abc.war and I want both /abc and /xyz to work for it.  I've
> tried adding aliases="/abc=abc.war,/xyz=abc.war" and
> aliases="/abc=abc,/xyz=abc" but neither of those worked.  This is
> how my original context.xml looked like.
> 
> <Context override="true" swallowOutput="true"> <!-- Doing
> swallowOutput=true to allow each web applications System.out and
> System.err calls to end up in a separate log, not in catalina.out. 
> See Jira CA-4589 --> <!-- Default set of monitored resources --> 
> <WatchedResource>WEB-INF/web.xml</WatchedResource> <!-- Disable
> session persistence across Tomcat restarts by including this line;
> no sessions used for many OGC implemenations--> <Manager
> pathname="" />
> 
> <!-- Uncomment this to enable Comet connection tacking (provides
> events on session expiration as well as webapp lifecycle) --> <!-- 
> <Valve 
> className="org.apache.catalina.valves.CometConnectionManagerValve"
> /> -->
> 
> </Context>
> 

Tomcat 7 aliases are intended to map URLs within a single web
application. You can't use it to duplicate the web application on two
base paths.

Here's what you need to do:

1. Put your WAR file in webapps/abc.war. This will deploy as usual.

2. Copy webapps/abc.war/META-INF/context.xml into
conf/Catalina/localhost/xyz.xml and modify the <Context> element like
this:

  <Context override="true" swallowOutput="true" docBase="webapps/abc.war
">
   ...
  </Context>

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYSeO/AAoJEBzwKT+lPKRYBkIQAKiBaS7HNJrBfROGNu1pif1d
ZPW1pyqXOp879TX9IjhViu8oSMQS1vymG4DrHscRUMlkdNuny+NHKecxKMv1La5i
DtQOt2Hax26QizANh+cp9QHaJejdMpNM3mc4ySYfqi5bL4m3MlO7D+NycFT321/q
mfKtDmH596B8TJRchoPjLCOl2jjPfvHSf2c1BVnztIOXXY/X4PwZfNiLv1uZDGnn
pqK77m6TAiiMjV9lrn2DX7i3wZi1tiG13PoF16CYubmTNixbmZ45gO3dr+VmH+h2
Q1hlN+MMghpbQ0Ukg1EYldA21ct31OjyG3ipinSHgTPygKV/ZvEIM3Zh67iU0bUn
xOkiQ3G6nACSRP+0+9qFqnSGN283RQKC1eS6/ZnpG+YLOtNbh60+gLyOQk4O9/pw
ZBabh7gOCjozHFmuDgcgec/Ql2kFS86fDBTX1QdjrhTdm/rH4rEAYShbL168gCC0
vt+kjqR2QPJPkpxeuYiPTdoAI7eOLX1M4JfStF9Dmce5291262t2PJdBYJjulfVS
cXVRjWgPCAiluBcyF2LME5E+jKEGeMtmBbK2+S8UVIXDS0MvKWLDln5PW8MAfWWr
xfSFTBqNOKVtEuz22KpYkbljfXrLxn2uY6TKTjQnwddpH4t1TP0qSpnxCe38j3WT
3j37VFuqdMGl0f54yk12
=hk95
-----END PGP SIGNATURE-----

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