Deploying app twice when change ROOT

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Deploying app twice when change ROOT

Blake McBride-4
Hi,

I am using tomcat 8.5.31 on a 64 bit Linux box running JDK 1.8.0_162.

I have several TLD's pointing to the same tomcat instance.  In
conf/server.xml I have the following _additional_ Host tag:

      <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
autoDeploy="false">
            <Context path="" docBase="myapp"/>
      </Host>

Under tomcat I have my app in the directory:  myappbase/myapp

I am able to access myapp via http://mydomain.com

This is as I desire.  The problem is that tomcat is deploying myapp twice!
Now I can access my app via:

 http://mydomain.com
      _and_
 http://mydomain.com/myapp

and, it's not just two ways of getting at the same app.  There is two
copies of the app running.

I know I can rename my app ROOT.  That works.  (I can access the app with
my other TLD and no suffix).  I don't want to do that because I have a
number of sites running a number of instances all of the same app.  Calling
them all ROOT is confusing.

Any help would sure be appreciated.

Blake McBride
Reply | Threaded
Open this post in threaded view
|

Re: Deploying app twice when change ROOT

markt
On 30/05/18 17:14, Blake McBride wrote:

> Hi,
>
> I am using tomcat 8.5.31 on a 64 bit Linux box running JDK 1.8.0_162.
>
> I have several TLD's pointing to the same tomcat instance.  In
> conf/server.xml I have the following _additional_ Host tag:
>
>       <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
> autoDeploy="false">
>             <Context path="" docBase="myapp"/>
>       </Host>
>
> Under tomcat I have my app in the directory:  myappbase/myapp
>
> I am able to access myapp via http://mydomain.com
>
> This is as I desire.  The problem is that tomcat is deploying myapp twice!
> Now I can access my app via:
>
>  http://mydomain.com
>       _and_
>  http://mydomain.com/myapp
>
> and, it's not just two ways of getting at the same app.  There is two
> copies of the app running.
>
> I know I can rename my app ROOT.  That works.  (I can access the app with
> my other TLD and no suffix).  I don't want to do that because I have a
> number of sites running a number of instances all of the same app.  Calling
> them all ROOT is confusing.
>
> Any help would sure be appreciated.

Name it ROOT##more-meaningful-name

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Deploying app twice when change ROOT

Blake McBride-4
I think I may have found something that works.  I changes it to:

      <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
autoDeploy="false" deployOnStartup="false">
            <Context path="" docBase="myapp"/>
      </Host>

(I added the deployOnStartup="false")  Now tomcat is still deploying
http://mydomain.com but it stopped deploying http://mydomain.com/myapp.
This is just what I wanted.

Thanks.

Blake



On Wed, May 30, 2018 at 11:29 AM, Mark Thomas <[hidden email]> wrote:

> On 30/05/18 17:14, Blake McBride wrote:
> > Hi,
> >
> > I am using tomcat 8.5.31 on a 64 bit Linux box running JDK 1.8.0_162.
> >
> > I have several TLD's pointing to the same tomcat instance.  In
> > conf/server.xml I have the following _additional_ Host tag:
> >
> >       <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
> > autoDeploy="false">
> >             <Context path="" docBase="myapp"/>
> >       </Host>
> >
> > Under tomcat I have my app in the directory:  myappbase/myapp
> >
> > I am able to access myapp via http://mydomain.com
> >
> > This is as I desire.  The problem is that tomcat is deploying myapp
> twice!
> > Now I can access my app via:
> >
> >  http://mydomain.com
> >       _and_
> >  http://mydomain.com/myapp
> >
> > and, it's not just two ways of getting at the same app.  There is two
> > copies of the app running.
> >
> > I know I can rename my app ROOT.  That works.  (I can access the app with
> > my other TLD and no suffix).  I don't want to do that because I have a
> > number of sites running a number of instances all of the same app.
> Calling
> > them all ROOT is confusing.
> >
> > Any help would sure be appreciated.
>
> Name it ROOT##more-meaningful-name
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Deploying app twice when change ROOT

Blake McBride-4
Your suggestion is better.  Mine prevents other apps from that host from
deploying altogether.


On Wed, May 30, 2018 at 11:34 AM, Blake McBride <[hidden email]> wrote:

> I think I may have found something that works.  I changes it to:
>
>       <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
> autoDeploy="false" deployOnStartup="false">
>             <Context path="" docBase="myapp"/>
>       </Host>
>
> (I added the deployOnStartup="false")  Now tomcat is still deploying
> http://mydomain.com but it stopped deploying http://mydomain.com/myapp.
> This is just what I wanted.
>
> Thanks.
>
> Blake
>
>
>
> On Wed, May 30, 2018 at 11:29 AM, Mark Thomas <[hidden email]> wrote:
>
>> On 30/05/18 17:14, Blake McBride wrote:
>> > Hi,
>> >
>> > I am using tomcat 8.5.31 on a 64 bit Linux box running JDK 1.8.0_162.
>> >
>> > I have several TLD's pointing to the same tomcat instance.  In
>> > conf/server.xml I have the following _additional_ Host tag:
>> >
>> >       <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
>> > autoDeploy="false">
>> >             <Context path="" docBase="myapp"/>
>> >       </Host>
>> >
>> > Under tomcat I have my app in the directory:  myappbase/myapp
>> >
>> > I am able to access myapp via http://mydomain.com
>> >
>> > This is as I desire.  The problem is that tomcat is deploying myapp
>> twice!
>> > Now I can access my app via:
>> >
>> >  http://mydomain.com
>> >       _and_
>> >  http://mydomain.com/myapp
>> >
>> > and, it's not just two ways of getting at the same app.  There is two
>> > copies of the app running.
>> >
>> > I know I can rename my app ROOT.  That works.  (I can access the app
>> with
>> > my other TLD and no suffix).  I don't want to do that because I have a
>> > number of sites running a number of instances all of the same app.
>> Calling
>> > them all ROOT is confusing.
>> >
>> > Any help would sure be appreciated.
>>
>> Name it ROOT##more-meaningful-name
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Deploying app twice when change ROOT

Blake McBride-4
IMO, tomcat should have code to allow my earlier configuration
(without the deployOnStartup="false")
and just detect that another app directory is the same as the declared root
and not deploy it again.  This problem is all over the net and cost me
hours.

Thanks!

Blake


On Wed, May 30, 2018 at 12:30 PM, Blake McBride <[hidden email]> wrote:

> Your suggestion is better.  Mine prevents other apps from that host from
> deploying altogether.
>
>
> On Wed, May 30, 2018 at 11:34 AM, Blake McBride <[hidden email]>
> wrote:
>
>> I think I may have found something that works.  I changes it to:
>>
>>       <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
>> autoDeploy="false" deployOnStartup="false">
>>             <Context path="" docBase="myapp"/>
>>       </Host>
>>
>> (I added the deployOnStartup="false")  Now tomcat is still deploying
>> http://mydomain.com but it stopped deploying http://mydomain.com/myapp.
>> This is just what I wanted.
>>
>> Thanks.
>>
>> Blake
>>
>>
>>
>> On Wed, May 30, 2018 at 11:29 AM, Mark Thomas <[hidden email]> wrote:
>>
>>> On 30/05/18 17:14, Blake McBride wrote:
>>> > Hi,
>>> >
>>> > I am using tomcat 8.5.31 on a 64 bit Linux box running JDK 1.8.0_162.
>>> >
>>> > I have several TLD's pointing to the same tomcat instance.  In
>>> > conf/server.xml I have the following _additional_ Host tag:
>>> >
>>> >       <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
>>> > autoDeploy="false">
>>> >             <Context path="" docBase="myapp"/>
>>> >       </Host>
>>> >
>>> > Under tomcat I have my app in the directory:  myappbase/myapp
>>> >
>>> > I am able to access myapp via http://mydomain.com
>>> >
>>> > This is as I desire.  The problem is that tomcat is deploying myapp
>>> twice!
>>> > Now I can access my app via:
>>> >
>>> >  http://mydomain.com
>>> >       _and_
>>> >  http://mydomain.com/myapp
>>> >
>>> > and, it's not just two ways of getting at the same app.  There is two
>>> > copies of the app running.
>>> >
>>> > I know I can rename my app ROOT.  That works.  (I can access the app
>>> with
>>> > my other TLD and no suffix).  I don't want to do that because I have a
>>> > number of sites running a number of instances all of the same app.
>>> Calling
>>> > them all ROOT is confusing.
>>> >
>>> > Any help would sure be appreciated.
>>>
>>> Name it ROOT##more-meaningful-name
>>>
>>> Mark
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Deploying app twice when change ROOT

markt
On 30/05/18 18:37, Blake McBride wrote:
> IMO, tomcat should have code to allow my earlier configuration
> (without the deployOnStartup="false")
> and just detect that another app directory is the same as the declared root
> and not deploy it again.  This problem is all over the net and cost me
> hours.

Tomcat is doing exactly what you told it to do.

The Tomcat docs recommend against defining Contexts in server.xml.

Further, the automatic deployment docs state:
<quote>
Note that if you are defining contexts explicitly in server.xml, you
should probably turn off automatic application deployment or specify
deployIgnore carefully. Otherwise, the web applications will each be
deployed twice, and that may cause problems for the applications.
</quote>

Mark


>
> Thanks!
>
> Blake
>
>
> On Wed, May 30, 2018 at 12:30 PM, Blake McBride <[hidden email]> wrote:
>
>> Your suggestion is better.  Mine prevents other apps from that host from
>> deploying altogether.
>>
>>
>> On Wed, May 30, 2018 at 11:34 AM, Blake McBride <[hidden email]>
>> wrote:
>>
>>> I think I may have found something that works.  I changes it to:
>>>
>>>       <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
>>> autoDeploy="false" deployOnStartup="false">
>>>             <Context path="" docBase="myapp"/>
>>>       </Host>
>>>
>>> (I added the deployOnStartup="false")  Now tomcat is still deploying
>>> http://mydomain.com but it stopped deploying http://mydomain.com/myapp.
>>> This is just what I wanted.
>>>
>>> Thanks.
>>>
>>> Blake
>>>
>>>
>>>
>>> On Wed, May 30, 2018 at 11:29 AM, Mark Thomas <[hidden email]> wrote:
>>>
>>>> On 30/05/18 17:14, Blake McBride wrote:
>>>>> Hi,
>>>>>
>>>>> I am using tomcat 8.5.31 on a 64 bit Linux box running JDK 1.8.0_162.
>>>>>
>>>>> I have several TLD's pointing to the same tomcat instance.  In
>>>>> conf/server.xml I have the following _additional_ Host tag:
>>>>>
>>>>>       <Host name="mydomain.com" appBase="myappbase" unpackWARs="false"
>>>>> autoDeploy="false">
>>>>>             <Context path="" docBase="myapp"/>
>>>>>       </Host>
>>>>>
>>>>> Under tomcat I have my app in the directory:  myappbase/myapp
>>>>>
>>>>> I am able to access myapp via http://mydomain.com
>>>>>
>>>>> This is as I desire.  The problem is that tomcat is deploying myapp
>>>> twice!
>>>>> Now I can access my app via:
>>>>>
>>>>>  http://mydomain.com
>>>>>       _and_
>>>>>  http://mydomain.com/myapp
>>>>>
>>>>> and, it's not just two ways of getting at the same app.  There is two
>>>>> copies of the app running.
>>>>>
>>>>> I know I can rename my app ROOT.  That works.  (I can access the app
>>>> with
>>>>> my other TLD and no suffix).  I don't want to do that because I have a
>>>>> number of sites running a number of instances all of the same app.
>>>> Calling
>>>>> them all ROOT is confusing.
>>>>>
>>>>> Any help would sure be appreciated.
>>>>
>>>> Name it ROOT##more-meaningful-name
>>>>
>>>> Mark
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]