You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dean Del Ponte <de...@gmail.com> on 2012/01/29 04:35:59 UTC

Tomcat 6 - How to make an application available at www.mydomain.com

I'm running tomcat 6 behind apache.

I currently have an application deployed as "myApplication" and it is
available at "http://www.mydomain.com/myApplication".

How can I make this application available at "http://www.mydomain.com"
without deploying it as ROOT.war?

My server is running Ubuntu 10.04.

Thanks!

Dean Del Ponte

RE: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Jeffrey Janner <Je...@PolyDyne.com>.
> -----Original Message-----
> From: André Warnier [mailto:aw@ice-sa.com]
> Sent: Sunday, January 29, 2012 7:07 AM
> To: Tomcat Users List
> Subject: Re: Tomcat 6 - How to make an application available at
> www.mydomain.com
> 
> John Renne wrote:
> > On Jan 29, 2012, at 1:27 PM, André Warnier wrote:
> >> Sorry to appear to pounce on you, but putting a <Context> element in
> server.xml is discouraged, see here :
> >> http://tomcat.apache.org/tomcat-6.0-
> doc/config/context.html#Introduction
> >>
> > No offense taken
> >
> >> I am not myself an expert, so treat this with caution, but to
> summarise so far :
> >
> > Same here, we're all doing the same, trying to be helpful in some way
> >> 1) the easiest and recommended way is to deploy the application as
> ${CATALINA_BASE}/webapps/ROOT.war. That is the normal place for an
> application invoked as "/", it will not confuse anyone, and it will
> work with or without a front-end.
> >
> > This isn't what the original poster asked, he asked for a way without
> renaming
> 
> Yes, but maybe this was for some reason of his, which is not
> necessarily a good one (we
> don't know, he did not give a reason).  As Chuck was pointing out, this
> is the recommended
> best practice, and it turns out to be the easiest in all respects.  So
> it is worth
> pointing it out anyway.
> 
> >
> >> 2) instead, in some cases (and only since Tomcat 7.x), you can use
> the "trick" indicated previously by Pid
> >
> > This isn't what the original poster asked, he was talking about
> Tomcat 6
> 
> And as Pid indicated, upgrading was a suggestion. Tomcat 7 is the
> current version, and it
> is "better" than Tomcat 6.  So again, it is worth suggesting.
> But of course, as the OP is under Ubuntu, he may want to use the Ubuntu
> packages (for ease
> of administration), and Tomcat 7 may not yet have made it it there.
> 
> >> 3) place a Context description in
> $CATALINA_BASE/conf/[enginename]/[hostname]/ROOT.xml, with an attribute
> : docBase="(full path to the application's .war archive)"  (whatever
> you decide to name the .war archive). Put the .war archive outside of
> tomcat's webapps directory then, to avoid a double deployment.
> >
> > This is a nice option, however putting war's outside of the webapps
> directory might be very confusing.
> 
> It would not be more confusing than where Ubuntu's Tomcat package is
> already putting the
> Tomcat files. ;-)
> And it may be a nice way to "insulate" his application from future
> Ubuntu Tomcat upgrades
> (which, by the way, also militates against putting a <Context> in
> server.xml).
> 
> >
> >> 4) deploy the application as you wish, and use VirtualHost and/or
> Rewrite and/or Proxy rules at the front-end httpd level to achieve what
> you want.  But this is more complex to do right as it appears
> initially. (You may have to be careful about links embedded inside your
> pages, for example).
> >>
> > This is a nice solution too, however if an application for some
> reason uses applets or generates it's URL's in a non-standard way, this
> might not work. I do realize the downsides of modifying the server.xml
> and including a context element, but it might be a working approach and
> answers the question the original poster has.
> >
> To emphasise a point made above : it often happens that someone comes
> here with a question
> such as "How do I do 'this', using 'that' ?".
> It oftens turns out that 'that' is not the best way of doing 'this',
> but is merely a way
> which the poster heard about from some more or less reputable source.
> Sometimes it is
> even so that 'that' is really unnecessarily complex, insecure,
> unreliable or wrong.
> People here then feel obliged to point this out, and recommend what
> they consider a better
> way of achieving 'this'.
> I think that's also part of the role of a list such as this one.
> 
> To give an egregious example : many people come here asking how they
> can do this or that
> at the Apache httpd front-end level, before proxying a call to Tomcat.
> Then upon further enquiry, it will come up that they are using a
> directive such as
> JkMount /* worker1
> Someone here then is bound to question why they are using a httpd
> front-end at all, and
> recommend that they perhaps get rid of it (and of the original problem
> at the same time).
> No doubt, this also does not match the original OP's question, but may
> not be a bad thing
> to ask, or ?
> 

In fact, André's last bit was going to be my suggestion to the OP, drop Apache altogether.  Once you move your app to the root level, Apache just becomes overhead (unless you need load-balancing or somesuch other feature).  I would take option #3 one step further and not even bother zipping the app into a war file, but deploy it somewhere on the filesystem as an already-exploded directory (original form).  Then point the ROOT.xml context descriptor at that directory, making sure the Tomcat user has the needed rights to the directory.

But, by far, the easiest way to accomplish what the OP wants as an end result is to zip the app into ROOT.war and deploy normally.
__________________________________________________________________________

Confidentiality Notice:  This Transmission (including any attachments) may contain information that is privileged, confidential, and exempt from disclosure under applicable law.  If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to the sender or telephone (512) 343-9100 and delete this transmission from your system.


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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by André Warnier <aw...@ice-sa.com>.
John Renne wrote:
> On Jan 29, 2012, at 1:27 PM, André Warnier wrote:
>> Sorry to appear to pounce on you, but putting a <Context> element in server.xml is discouraged, see here :
>> http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Introduction
>>
> No offense taken 
> 
>> I am not myself an expert, so treat this with caution, but to summarise so far :
> 
> Same here, we're all doing the same, trying to be helpful in some way
>> 1) the easiest and recommended way is to deploy the application as ${CATALINA_BASE}/webapps/ROOT.war. That is the normal place for an application invoked as "/", it will not confuse anyone, and it will work with or without a front-end.
> 
> This isn't what the original poster asked, he asked for a way without renaming

Yes, but maybe this was for some reason of his, which is not necessarily a good one (we 
don't know, he did not give a reason).  As Chuck was pointing out, this is the recommended 
best practice, and it turns out to be the easiest in all respects.  So it is worth 
pointing it out anyway.

> 
>> 2) instead, in some cases (and only since Tomcat 7.x), you can use the "trick" indicated previously by Pid
> 
> This isn't what the original poster asked, he was talking about Tomcat 6

And as Pid indicated, upgrading was a suggestion. Tomcat 7 is the current version, and it 
is "better" than Tomcat 6.  So again, it is worth suggesting.
But of course, as the OP is under Ubuntu, he may want to use the Ubuntu packages (for ease 
of administration), and Tomcat 7 may not yet have made it it there.

>> 3) place a Context description in $CATALINA_BASE/conf/[enginename]/[hostname]/ROOT.xml, with an attribute : docBase="(full path to the application's .war archive)"  (whatever you decide to name the .war archive). Put the .war archive outside of tomcat's webapps directory then, to avoid a double deployment.
> 
> This is a nice option, however putting war's outside of the webapps directory might be very confusing. 

It would not be more confusing than where Ubuntu's Tomcat package is already putting the 
Tomcat files. ;-)
And it may be a nice way to "insulate" his application from future Ubuntu Tomcat upgrades 
(which, by the way, also militates against putting a <Context> in server.xml).

> 
>> 4) deploy the application as you wish, and use VirtualHost and/or Rewrite and/or Proxy rules at the front-end httpd level to achieve what you want.  But this is more complex to do right as it appears initially. (You may have to be careful about links embedded inside your pages, for example).
>>
> This is a nice solution too, however if an application for some reason uses applets or generates it's URL's in a non-standard way, this might not work. I do realize the downsides of modifying the server.xml and including a context element, but it might be a working approach and answers the question the original poster has. 
> 
To emphasise a point made above : it often happens that someone comes here with a question 
such as "How do I do 'this', using 'that' ?".
It oftens turns out that 'that' is not the best way of doing 'this', but is merely a way 
which the poster heard about from some more or less reputable source.  Sometimes it is 
even so that 'that' is really unnecessarily complex, insecure, unreliable or wrong.
People here then feel obliged to point this out, and recommend what they consider a better 
way of achieving 'this'.
I think that's also part of the role of a list such as this one.

To give an egregious example : many people come here asking how they can do this or that 
at the Apache httpd front-end level, before proxying a call to Tomcat.
Then upon further enquiry, it will come up that they are using a directive such as
JkMount /* worker1
Someone here then is bound to question why they are using a httpd front-end at all, and 
recommend that they perhaps get rid of it (and of the original problem at the same time).
No doubt, this also does not match the original OP's question, but may not be a bad thing 
to ask, or ?

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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by John Renne <jo...@gniffelnieuws.net>.
On Jan 29, 2012, at 1:27 PM, André Warnier wrote:
> 
> Sorry to appear to pounce on you, but putting a <Context> element in server.xml is discouraged, see here :
> http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Introduction
> 
No offense taken 

> I am not myself an expert, so treat this with caution, but to summarise so far :

Same here, we're all doing the same, trying to be helpful in some way
> 
> 1) the easiest and recommended way is to deploy the application as ${CATALINA_BASE}/webapps/ROOT.war. That is the normal place for an application invoked as "/", it will not confuse anyone, and it will work with or without a front-end.

This isn't what the original poster asked, he asked for a way without renaming

> 2) instead, in some cases (and only since Tomcat 7.x), you can use the "trick" indicated previously by Pid

This isn't what the original poster asked, he was talking about Tomcat 6
> 3) place a Context description in $CATALINA_BASE/conf/[enginename]/[hostname]/ROOT.xml, with an attribute : docBase="(full path to the application's .war archive)"  (whatever you decide to name the .war archive). Put the .war archive outside of tomcat's webapps directory then, to avoid a double deployment.

This is a nice option, however putting war's outside of the webapps directory might be very confusing. 

> 4) deploy the application as you wish, and use VirtualHost and/or Rewrite and/or Proxy rules at the front-end httpd level to achieve what you want.  But this is more complex to do right as it appears initially. (You may have to be careful about links embedded inside your pages, for example).
> 
This is a nice solution too, however if an application for some reason uses applets or generates it's URL's in a non-standard way, this might not work. I do realize the downsides of modifying the server.xml and including a context element, but it might be a working approach and answers the question the original poster has. 

John


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by André Warnier <aw...@ice-sa.com>.
John Renne wrote:
> On Jan 29, 2012, at 4:35 AM, Dean Del Ponte wrote:
> 
>> I'm running tomcat 6 behind apache.
>>
>> I currently have an application deployed as "myApplication" and it is
>> available at "http://www.mydomain.com/myApplication".
>>
>> How can I make this application available at "http://www.mydomain.com"
>> without deploying it as ROOT.war?
>>
> If I remember well, you could accomplish this by adding a line like this in the server.xml:
> <Context path="" docbase="myApplication">
> </Context>
> 
> I've always considered it a bit ugly but it should do the trick
> 

Sorry to appear to pounce on you, but putting a <Context> element in server.xml is 
discouraged, see here :
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html#Introduction

I am not myself an expert, so treat this with caution, but to summarise so far :

1) the easiest and recommended way is to deploy the application as 
${CATALINA_BASE}/webapps/ROOT.war. That is the normal place for an application invoked as 
"/", it will not confuse anyone, and it will work with or without a front-end.
2) instead, in some cases (and only since Tomcat 7.x), you can use the "trick" indicated 
previously by Pid
3) place a Context description in $CATALINA_BASE/conf/[enginename]/[hostname]/ROOT.xml, 
with an attribute : docBase="(full path to the application's .war archive)"  (whatever you 
decide to name the .war archive). Put the .war archive outside of tomcat's webapps 
directory then, to avoid a double deployment.
4) deploy the application as you wish, and use VirtualHost and/or Rewrite and/or Proxy 
rules at the front-end httpd level to achieve what you want.  But this is more complex to 
do right as it appears initially. (You may have to be careful about links embedded inside 
your pages, for example).



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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by John Renne <jo...@gniffelnieuws.net>.
On Jan 29, 2012, at 4:35 AM, Dean Del Ponte wrote:

> I'm running tomcat 6 behind apache.
> 
> I currently have an application deployed as "myApplication" and it is
> available at "http://www.mydomain.com/myApplication".
> 
> How can I make this application available at "http://www.mydomain.com"
> without deploying it as ROOT.war?
> 
If I remember well, you could accomplish this by adding a line like this in the server.xml:
<Context path="" docbase="myApplication">
</Context>

I've always considered it a bit ugly but it should do the trick

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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Pid <pi...@pidster.com>.
On 29/01/2012 10:46, Borut Hadžialić wrote:
> Hi,
> 
> the best way is to deploy your application to run inside tomcat
> without a context path - eg. to be available at http://localhost:8080/
> instead of http://localhost:8080/myApplication and use your apache
> reverse proxying / virtual host as it is.
> 
> Trying to strip application context in virtual host configuration in
> my expirience was troublesome in some of my expiriences and now I
> always try to avoid it.
> 
> What do you mean exactly by "without deploying it as ROOT.war"?
> 
> You can set the context path of your Tomcat deployed applications to
> whatever you want - context path doesn't have to be the same as .war
> archive name. Just stop using deployment trough webapps directory and
> start using context files inside tomcat-x.x.x/conf directory to define
> your applications (all explained here
> http://tomcat.apache.org/tomcat-6.0-doc/config/context.html ), for
> example:
> 
> 1. Make a file called
> ${catalina.base}/conf/Catalina/localhost.ROOT.xml that contains:
> 
> <?xml version='1.0' encoding='utf-8'?>
> <Context docBase="${catalina.base}/war/myApplication.war" path="">
>  <Manager pathname=""/>
> </Context>

The path attribute is not valid here.


p

> 2. Copy you myApplication.war to ${catalina.base}/war - or some other
> directory if you want to arange things differently.
> 
> 3. Remove myApplication.war from ${catalina.base}/webapps
> 
> Where ${catalina.base} is you current tomcat installation (or base
> instance) where you are currently deploying you app.
> 
> 
> 
> On 1/29/12, Thomas Rohde <tr...@ordix.de> wrote:
>>> I'm running tomcat 6 behind apache.
>>>
>>> I currently have an application deployed as "myApplication" and it is
>>> available at "http://www.mydomain.com/myApplication".
>>>
>>> How can I make this application available at "http://www.mydomain.com"
>>> without deploying it as ROOT.war?
>>>
>>> My server is running Ubuntu 10.04.
>>>
>>> Thanks!
>>>
>>> Dean Del Ponte
>>>
>>
>> You could use a rewrite rule to achieve that:
>>
>> RewriteEngine On
>> RewriteRule ^/$ /myApplication/ [PT]
>> JkMount /myApplication* tomcat
>>
>> Works for me very well.
>>
>> Thomas
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 


-- 

[key:62590808]


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Borut Hadžialić <bo...@gmail.com>.
Just a small correction:

1. Make a file called
${catalina.base}/conf/Catalina/localhost/ROOT.xml that contains:

instead of

1. Make a file called
${catalina.base}/conf/Catalina/localhost.ROOT.xml that contains:

On 1/29/12, Borut Hadžialić <bo...@gmail.com> wrote:
> Hi,
>
> the best way is to deploy your application to run inside tomcat
> without a context path - eg. to be available at http://localhost:8080/
> instead of http://localhost:8080/myApplication and use your apache
> reverse proxying / virtual host as it is.
>
> Trying to strip application context in virtual host configuration in
> my expirience was troublesome in some of my expiriences and now I
> always try to avoid it.
>
> What do you mean exactly by "without deploying it as ROOT.war"?
>
> You can set the context path of your Tomcat deployed applications to
> whatever you want - context path doesn't have to be the same as .war
> archive name. Just stop using deployment trough webapps directory and
> start using context files inside tomcat-x.x.x/conf directory to define
> your applications (all explained here
> http://tomcat.apache.org/tomcat-6.0-doc/config/context.html ), for
> example:
>
> 1. Make a file called
> ${catalina.base}/conf/Catalina/localhost.ROOT.xml that contains:
>
> <?xml version='1.0' encoding='utf-8'?>
> <Context docBase="${catalina.base}/war/myApplication.war" path="">
>  <Manager pathname=""/>
> </Context>
>
> 2. Copy you myApplication.war to ${catalina.base}/war - or some other
> directory if you want to arange things differently.
>
> 3. Remove myApplication.war from ${catalina.base}/webapps
>
> Where ${catalina.base} is you current tomcat installation (or base
> instance) where you are currently deploying you app.
>
>
>
> On 1/29/12, Thomas Rohde <tr...@ordix.de> wrote:
>>> I'm running tomcat 6 behind apache.
>>>
>>> I currently have an application deployed as "myApplication" and it is
>>> available at "http://www.mydomain.com/myApplication".
>>>
>>> How can I make this application available at "http://www.mydomain.com"
>>> without deploying it as ROOT.war?
>>>
>>> My server is running Ubuntu 10.04.
>>>
>>> Thanks!
>>>
>>> Dean Del Ponte
>>>
>>
>> You could use a rewrite rule to achieve that:
>>
>> RewriteEngine On
>> RewriteRule ^/$ /myApplication/ [PT]
>> JkMount /myApplication* tomcat
>>
>> Works for me very well.
>>
>> Thomas
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
> --
> Why?
> Because YES!
>


-- 
Why?
Because YES!

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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Borut Hadžialić <bo...@gmail.com>.
Hi,

the best way is to deploy your application to run inside tomcat
without a context path - eg. to be available at http://localhost:8080/
instead of http://localhost:8080/myApplication and use your apache
reverse proxying / virtual host as it is.

Trying to strip application context in virtual host configuration in
my expirience was troublesome in some of my expiriences and now I
always try to avoid it.

What do you mean exactly by "without deploying it as ROOT.war"?

You can set the context path of your Tomcat deployed applications to
whatever you want - context path doesn't have to be the same as .war
archive name. Just stop using deployment trough webapps directory and
start using context files inside tomcat-x.x.x/conf directory to define
your applications (all explained here
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html ), for
example:

1. Make a file called
${catalina.base}/conf/Catalina/localhost.ROOT.xml that contains:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="${catalina.base}/war/myApplication.war" path="">
 <Manager pathname=""/>
</Context>

2. Copy you myApplication.war to ${catalina.base}/war - or some other
directory if you want to arange things differently.

3. Remove myApplication.war from ${catalina.base}/webapps

Where ${catalina.base} is you current tomcat installation (or base
instance) where you are currently deploying you app.



On 1/29/12, Thomas Rohde <tr...@ordix.de> wrote:
>> I'm running tomcat 6 behind apache.
>>
>> I currently have an application deployed as "myApplication" and it is
>> available at "http://www.mydomain.com/myApplication".
>>
>> How can I make this application available at "http://www.mydomain.com"
>> without deploying it as ROOT.war?
>>
>> My server is running Ubuntu 10.04.
>>
>> Thanks!
>>
>> Dean Del Ponte
>>
>
> You could use a rewrite rule to achieve that:
>
> RewriteEngine On
> RewriteRule ^/$ /myApplication/ [PT]
> JkMount /myApplication* tomcat
>
> Works for me very well.
>
> Thomas
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Why?
Because YES!

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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Thomas Rohde <tr...@ordix.de>.
> André Warnier wrote:
>> Thomas Rohde wrote:
>>>> I'm running tomcat 6 behind apache.
>>>>
>>>> I currently have an application deployed as "myApplication" and it is
>>>> available at "http://www.mydomain.com/myApplication".
>>>>
>>>> How can I make this application available at "http://www.mydomain.com"
>>>> without deploying it as ROOT.war?
>>>>
>>>> My server is running Ubuntu 10.04.
>>>>
>>>> Thanks!
>>>>
>>>> Dean Del Ponte
>>>>
>>>
>>> You could use a rewrite rule to achieve that:
>>>
>>> RewriteEngine On
>>> RewriteRule ^/$ /myApplication/ [PT]
>>> JkMount /myApplication* tomcat
>>>
>>> Works for me very well.
>>>
>>
>> That is assuming that the OP has an Apache httpd front-end, which he
>> never said.
>
> Ooops, he did...
>
>> Also, even if he has, the above is not enough except in the simplest of
>> cases.
>> As far as I can tell also, this RewriteRule only rewrites requests to
>> "/".
>> If that is enough to make it work for you, then one could wonder why you
>> need an httpd front-end in the first place.

This is a virtual host specific configuration and so it doesn't affect the
whole apache web server.

>> Note also that the JkMount above will not only proxy "/myApplication"
>> and "/myApplication/*", but just as well "/myApplication_as_a_prefix"
>> and anything else starting with "myApplication".  This may or may not be
>> what you want, in terms of security for example.
>>
>> Chuck's recommendation is still the best.
>> The above notes already illustrate some of the reasons.
>> Let's see if the OP really has a good reason /not to/ deploy his
>> application as ROOT.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>



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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Thomas Rohde <tr...@ordix.de>.
> Thomas Rohde wrote:
>>
>> That is a good point. I will change my configuration to
>>
>>    JkMount /myApplication/* tomcat
>>
> Actually, you need 2 lines to cover all :
>
>  >    JkMount /myApplication tomcat          # for the index ?
>  >    JkMount /myApplication/* tomcat        # for the rest

Yes, I've already figured that out.

>
> Or you can use the following syntax :
>
> <Location /myApplication>
>    SetHandler jakarta-servlet
>    ...
> </Location>

That was actually new for me. I'll try it next time. Thank you!

>
> I personally like this second form better : it fits better with the
> general Apache httpd
> configuration style, and it allows for other httpd-level things in the
> same section.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>



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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by André Warnier <aw...@ice-sa.com>.
Thomas Rohde wrote:
> 
> That is a good point. I will change my configuration to
> 
>    JkMount /myApplication/* tomcat
> 
Actually, you need 2 lines to cover all :

 >    JkMount /myApplication tomcat          # for the index ?
 >    JkMount /myApplication/* tomcat        # for the rest

Or you can use the following syntax :

<Location /myApplication>
   SetHandler jakarta-servlet
   ...
</Location>

I personally like this second form better : it fits better with the general Apache httpd 
configuration style, and it allows for other httpd-level things in the same section.


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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Thomas Rohde <tr...@ordix.de>.
> André Warnier wrote:
>> Thomas Rohde wrote:
>>>> I'm running tomcat 6 behind apache.
>>>>
>>>> I currently have an application deployed as "myApplication" and it is
>>>> available at "http://www.mydomain.com/myApplication".
>>>>
>>>> How can I make this application available at "http://www.mydomain.com"
>>>> without deploying it as ROOT.war?
>>>>
>>>> My server is running Ubuntu 10.04.
>>>>
>>>> Thanks!
>>>>
>>>> Dean Del Ponte
>>>>
>>>
>>> You could use a rewrite rule to achieve that:
>>>
>>> RewriteEngine On
>>> RewriteRule ^/$ /myApplication/ [PT]
>>> JkMount /myApplication* tomcat
>>>
>>> Works for me very well.
>>>
>>
>> That is assuming that the OP has an Apache httpd front-end, which he
>> never said.
>
> Ooops, he did...

Yes. ;-)

>
>> Also, even if he has, the above is not enough except in the simplest of
>> cases.
>> As far as I can tell also, this RewriteRule only rewrites requests to
>> "/".
>> If that is enough to make it work for you, then one could wonder why you
>> need an httpd front-end in the first place.
>> Note also that the JkMount above will not only proxy "/myApplication"
>> and "/myApplication/*", but just as well "/myApplication_as_a_prefix"
>> and anything else starting with "myApplication".  This may or may not be
>> what you want, in terms of security for example.

That is a good point. I will change my configuration to

   JkMount /myApplication/* tomcat

Thank you!

>>
>> Chuck's recommendation is still the best.
>> The above notes already illustrate some of the reasons.
>> Let's see if the OP really has a good reason /not to/ deploy his
>> application as ROOT.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>



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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by André Warnier <aw...@ice-sa.com>.
André Warnier wrote:
> Thomas Rohde wrote:
>>> I'm running tomcat 6 behind apache.
>>>
>>> I currently have an application deployed as "myApplication" and it is
>>> available at "http://www.mydomain.com/myApplication".
>>>
>>> How can I make this application available at "http://www.mydomain.com"
>>> without deploying it as ROOT.war?
>>>
>>> My server is running Ubuntu 10.04.
>>>
>>> Thanks!
>>>
>>> Dean Del Ponte
>>>
>>
>> You could use a rewrite rule to achieve that:
>>
>> RewriteEngine On
>> RewriteRule ^/$ /myApplication/ [PT]
>> JkMount /myApplication* tomcat
>>
>> Works for me very well.
>>
> 
> That is assuming that the OP has an Apache httpd front-end, which he 
> never said.

Ooops, he did...

> Also, even if he has, the above is not enough except in the simplest of 
> cases.
> As far as I can tell also, this RewriteRule only rewrites requests to "/".
> If that is enough to make it work for you, then one could wonder why you 
> need an httpd front-end in the first place.
> Note also that the JkMount above will not only proxy "/myApplication" 
> and "/myApplication/*", but just as well "/myApplication_as_a_prefix" 
> and anything else starting with "myApplication".  This may or may not be 
> what you want, in terms of security for example.
> 
> Chuck's recommendation is still the best.
> The above notes already illustrate some of the reasons.
> Let's see if the OP really has a good reason /not to/ deploy his 
> application as ROOT.
> 

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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by André Warnier <aw...@ice-sa.com>.
Thomas Rohde wrote:
>> I'm running tomcat 6 behind apache.
>>
>> I currently have an application deployed as "myApplication" and it is
>> available at "http://www.mydomain.com/myApplication".
>>
>> How can I make this application available at "http://www.mydomain.com"
>> without deploying it as ROOT.war?
>>
>> My server is running Ubuntu 10.04.
>>
>> Thanks!
>>
>> Dean Del Ponte
>>
> 
> You could use a rewrite rule to achieve that:
> 
> RewriteEngine On
> RewriteRule ^/$ /myApplication/ [PT]
> JkMount /myApplication* tomcat
> 
> Works for me very well.
> 

That is assuming that the OP has an Apache httpd front-end, which he never said.
Also, even if he has, the above is not enough except in the simplest of cases.
As far as I can tell also, this RewriteRule only rewrites requests to "/".
If that is enough to make it work for you, then one could wonder why you need an httpd 
front-end in the first place.
Note also that the JkMount above will not only proxy "/myApplication" and 
"/myApplication/*", but just as well "/myApplication_as_a_prefix" and anything else 
starting with "myApplication".  This may or may not be what you want, in terms of security 
for example.

Chuck's recommendation is still the best.
The above notes already illustrate some of the reasons.
Let's see if the OP really has a good reason /not to/ deploy his application as ROOT.


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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Thomas Rohde <tr...@ordix.de>.
> I'm running tomcat 6 behind apache.
>
> I currently have an application deployed as "myApplication" and it is
> available at "http://www.mydomain.com/myApplication".
>
> How can I make this application available at "http://www.mydomain.com"
> without deploying it as ROOT.war?
>
> My server is running Ubuntu 10.04.
>
> Thanks!
>
> Dean Del Ponte
>

You could use a rewrite rule to achieve that:

RewriteEngine On
RewriteRule ^/$ /myApplication/ [PT]
JkMount /myApplication* tomcat

Works for me very well.

Thomas


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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Mark Thomas <ma...@apache.org>.
On 29/01/2012 11:06, Pid wrote:
> On 29/01/2012 03:42, Caldarale, Charles R wrote:
>>> From: Dean Del Ponte [mailto:dean.delponte@gmail.com] Subject:
>>> Tomcat 6 - How to make an application available at
>>> www.mydomain.com
>> 
>>> How can I make this application available at
>>> "http://www.mydomain.com" without deploying it as ROOT.war?
>> 
>> Just save yourself much grief and go ahead and deploy it as
>> ROOT.war - follow best practice.
> 
> +1  A trivial example: if someone else who doesn't understand the
> config administers the server in future and inadvertently places a
> ROOT.war file in the appBase...
> 
> If, for some reason, you really, really need to see what the
> application is called, then consider upgrading to Tomcat 7.0 and
> using the parallel deployment feature.  Then you can name your
> application:
> 
> ROOT##my-important-app-name-1.0.war
> 
> The whole of the section after ## is considered to be part of the 
> version identifier.  I think this is a much better way of
> addressing the usual argument about naming & leaves the application
> layout on the file system easy to understand.

Genius. I love it.

Mark

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


Re: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by Pid <pi...@pidster.com>.
On 29/01/2012 03:42, Caldarale, Charles R wrote:
>> From: Dean Del Ponte [mailto:dean.delponte@gmail.com] 
>> Subject: Tomcat 6 - How to make an application available at www.mydomain.com
> 
>> How can I make this application available at "http://www.mydomain.com"
>> without deploying it as ROOT.war?
> 
> Just save yourself much grief and go ahead and deploy it as ROOT.war - follow best practice.

+1  A trivial example: if someone else who doesn't understand the config
administers the server in future and inadvertently places a ROOT.war
file in the appBase...

If, for some reason, you really, really need to see what the application
is called, then consider upgrading to Tomcat 7.0 and using the parallel
deployment feature.  Then you can name your application:

 ROOT##my-important-app-name-1.0.war

The whole of the section after ## is considered to be part of the
version identifier.  I think this is a much better way of addressing the
usual argument about naming & leaves the application layout on the file
system easy to understand.


p

>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


-- 

[key:62590808]


RE: Tomcat 6 - How to make an application available at www.mydomain.com

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Dean Del Ponte [mailto:dean.delponte@gmail.com] 
> Subject: Tomcat 6 - How to make an application available at www.mydomain.com

> How can I make this application available at "http://www.mydomain.com"
> without deploying it as ROOT.war?

Just save yourself much grief and go ahead and deploy it as ROOT.war - follow best practice.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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