Re: Different webapp paths on different hosts

2013-02-02 Thread bxqdev



On 1/28/2013 7:13 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

bxqdev,

On 1/26/13 1:09 AM, bxqdev wrote:



On 1/26/2013 1:05 AM, Christopher Schultz wrote: Dude,

On 1/25/13 12:38 AM, bxqdev wrote:

i want to have one instance of webapp,


No problem.


which has two paths,


Problem: one context = one path = one instance

If you want two separate paths, you need two separate contexts.


and each of the paths serves the root of different domains


That just doesn't make any sense. The root of a domain is, by
definition, / (contextPath=), so there aren't any other paths
to consider.


looks like the goal is not reachable with plain tomcat
configuration.




once again: * one webapp * has 2 different paths: /path1
and /path2 * served on 2 domains * when user goes to
http://path1.com/ - {webapp}/path1 is served as root path *
when user goes to http://path2.com/ - {webapp}/path2 is
served as root path

is it possible?


What you are saying is nonsensical (specifically, the part where
you say that you want /path1 to be mapped to root.

If you want two virtual hosts, then define two virtual hosts. If
you want an app on each host configured as ROOT, then make your
two virtual hosts have two separate appBase directories (which
should be a requirement in the first place of two virtual hosts)
and toss a copy of your WAR file in each appBase, both named
ROOT.war (cApITaLS matter).

You can't deploy a single copy (in memory) of your webapp and
expect to get all your requirements above met. If you want to have
a single WAR file on the disk and deploy it multiple times, you
*can* do that but I'm not sure why anyone would want to.


looks like the goal is not reachable with plain tomcat
configuration.


I seriously don't understand your goal or your problem. It sounds
like you want two separate webapps smashed into a single context where
one webapp gets served by one domain and another webapps gets served
by the other domain. I don't know why you don't just split them up
into two separate webapps just like $DIETY intended.


if that was the solution, i wouldn't ask the question in the first place.



- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEGlY0ACgkQ9CaO5/Lv0PD86wCfcid6tNjOzzR0BJZh2tF5672y
09kAmwQ/o+S3jP3Ii033Wfm1UkVmecXs
=shqR
-END PGP SIGNATURE-

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



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



Re: Different webapp paths on different hosts

2013-02-02 Thread bxqdev



On 1/28/2013 7:11 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

bxqdev,

On 1/26/13 3:04 PM, bxqdev wrote:

On 1/26/2013 9:36 PM, Caldarale, Charles R wrote:

From: cjder...@gmail.com [mailto:cjder...@gmail.com] On Behalf
Of chris derham Subject: Re: Different webapp paths on
different hosts



To my mind if you deploy the app as ROOT.war, as long as DNS
is configured correctly, that single context will serve
responses to http://app1.com/ and http://app2.com/. This
appears solves the explicit requirement stated above.


Which is what I suggested back on 23 January:


Assuming path1.com and path2.com evaluate to the same IP
address (or at least to the same system), this will happen
automatically with a single Host element in the Tomcat
configuration.


But the OP refuses to supply any information about why that's
not sufficient.

- Chuck


in this case http://app1.com/ and http://app2.com/ will serve the
same content. i need different content on different domains.


Something actually made a little pop in my brain when I read that. I
gotta go... I think I smell toast burning...


i take it as you don't know the correct answer.



- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEGlRIACgkQ9CaO5/Lv0PBywQCeO1wxbRMQX6reeKVzCaYCjIY8
F74An104rdsUKFUucCNBZgfBC3Mh+7Lr
=d8JI
-END PGP SIGNATURE-

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



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



Re: Different webapp paths on different hosts

2013-02-02 Thread chris derham
 To my mind if you deploy the app as ROOT.war, as long as DNS
 is configured correctly, that single context will serve
 responses to http://app1.com/ and http://app2.com/. This
 appears solves the explicit requirement stated above.

 But the OP refuses to supply any information about why that's
 not sufficient.

 in this case http://app1.com/ and http://app2.com/ will serve the
 same content. i need different content on different domains.

You asked how can I serve content from one domain to one host, and a
different set of content for another domain. You were told that the
easiest way is to deploy two separate apps. You said that isn't what
you want, but did not explain why. What technical reason is this not a
suitable solution?

If you really want a single app deployed that sends different content
depending on the host used, then you will need to code that inside
your app. This isn't really application/web server issue, its
something that needs to be handled inside the web app

 Something actually made a little pop in my brain when I read that. I
 gotta go... I think I smell toast burning...

 i take it as you don't know the correct answer.

You asked an incredibly badly question, and didn't provide a clear
explanation of what you wanted people to help you with. Free advice
from people donated in their own time, and now 22 emails in and you
are getting snarky? Do you think that this is really going to
encourage people to help you?

Chris

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



Re: Different webapp paths on different hosts

2013-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

bxqdev,

On 1/26/13 3:04 PM, bxqdev wrote:
 On 1/26/2013 9:36 PM, Caldarale, Charles R wrote:
 From: cjder...@gmail.com [mailto:cjder...@gmail.com] On Behalf
 Of chris derham Subject: Re: Different webapp paths on
 different hosts
 
 To my mind if you deploy the app as ROOT.war, as long as DNS
 is configured correctly, that single context will serve
 responses to http://app1.com/ and http://app2.com/. This
 appears solves the explicit requirement stated above.
 
 Which is what I suggested back on 23 January:
 
 Assuming path1.com and path2.com evaluate to the same IP
 address (or at least to the same system), this will happen
 automatically with a single Host element in the Tomcat
 configuration.
 
 But the OP refuses to supply any information about why that's
 not sufficient.
 
 - Chuck
 
 in this case http://app1.com/ and http://app2.com/ will serve the
 same content. i need different content on different domains.

Something actually made a little pop in my brain when I read that. I
gotta go... I think I smell toast burning...

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEGlRIACgkQ9CaO5/Lv0PBywQCeO1wxbRMQX6reeKVzCaYCjIY8
F74An104rdsUKFUucCNBZgfBC3Mh+7Lr
=d8JI
-END PGP SIGNATURE-

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



Re: Different webapp paths on different hosts

2013-01-28 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

bxqdev,

On 1/26/13 1:09 AM, bxqdev wrote:
 
 
 On 1/26/2013 1:05 AM, Christopher Schultz wrote: Dude,
 
 On 1/25/13 12:38 AM, bxqdev wrote:
 i want to have one instance of webapp,
 
 No problem.
 
 which has two paths,
 
 Problem: one context = one path = one instance
 
 If you want two separate paths, you need two separate contexts.
 
 and each of the paths serves the root of different domains
 
 That just doesn't make any sense. The root of a domain is, by 
 definition, / (contextPath=), so there aren't any other paths
 to consider.
 
 looks like the goal is not reachable with plain tomcat
 configuration.
 
 
 once again: * one webapp * has 2 different paths: /path1
 and /path2 * served on 2 domains * when user goes to 
 http://path1.com/ - {webapp}/path1 is served as root path *
 when user goes to http://path2.com/ - {webapp}/path2 is
 served as root path
 
 is it possible?
 
 What you are saying is nonsensical (specifically, the part where
 you say that you want /path1 to be mapped to root.
 
 If you want two virtual hosts, then define two virtual hosts. If
 you want an app on each host configured as ROOT, then make your
 two virtual hosts have two separate appBase directories (which
 should be a requirement in the first place of two virtual hosts)
 and toss a copy of your WAR file in each appBase, both named
 ROOT.war (cApITaLS matter).
 
 You can't deploy a single copy (in memory) of your webapp and
 expect to get all your requirements above met. If you want to have
 a single WAR file on the disk and deploy it multiple times, you
 *can* do that but I'm not sure why anyone would want to.
 
 looks like the goal is not reachable with plain tomcat
 configuration.

I seriously don't understand your goal or your problem. It sounds
like you want two separate webapps smashed into a single context where
one webapp gets served by one domain and another webapps gets served
by the other domain. I don't know why you don't just split them up
into two separate webapps just like $DIETY intended.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEGlY0ACgkQ9CaO5/Lv0PD86wCfcid6tNjOzzR0BJZh2tF5672y
09kAmwQ/o+S3jP3Ii033Wfm1UkVmecXs
=shqR
-END PGP SIGNATURE-

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



Re: Different webapp paths on different hosts

2013-01-26 Thread chris derham

 it's not. maybe it will make things clear if i change the names of the
 paths, say:

 * when user goes to http://app1.com/ - {thesamewebapp}/app1 path is served
 as root path of the domain app1.com
 * when user goes to http://app2.com/ - {thesamewebapp}/app2 path is served
 as root path of the domain app2.com


From this I conclude that the explicit requirement is to have a single
running version of the war, that responds to different domains. You
seem to think that you have an additional implicit requirement that
this must be done within tomcat by having different contexts. This
seems to me to be the source of confusion in all the replies to your
thread.


 What you are trying to do is make the same webapp answer both
 domain1.com/ and domain2.com/ right? If so you can simply
 deploy the webapp as ROOT. The webapp will then answer on all domains
 pointing to the server. If this is not what you want, you
 can set up a virtual host in server.xml with an appbase outside the
 webapps folder (eg. $CATALINA_BASE (or is it HOME?)$\domain1
 and then use the Alias element to specify the second domain as an alias
 for the first (which you set as an attribute in the
 Host element).


 i know these tricks, but they don't work for my case.

To my mind if you deploy the app as ROOT.war, as long as DNS is
configured correctly, that single context will serve responses to
http://app1.com/ and http://app2.com/. This appears solves the
explicit requirement stated above. However you state they don't work
for my case - please explain why this doesn't work for your case

Thanks

Chris

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



RE: Different webapp paths on different hosts

2013-01-26 Thread Caldarale, Charles R
 From: cjder...@gmail.com [mailto:cjder...@gmail.com] On Behalf Of chris derham
 Subject: Re: Different webapp paths on different hosts

 To my mind if you deploy the app as ROOT.war, as long as DNS is
 configured correctly, that single context will serve responses to
 http://app1.com/ and http://app2.com/. This appears solves the
 explicit requirement stated above.

Which is what I suggested back on 23 January:
 
 Assuming path1.com and path2.com evaluate to the same IP address (or 
 at least to the same system), this will happen automatically with a 
 single Host element in the Tomcat configuration. 

But the OP refuses to supply any information about why that's not sufficient.

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Different webapp paths on different hosts

2013-01-26 Thread bxqdev



On 1/26/2013 9:23 PM, chris derham wrote:


it's not. maybe it will make things clear if i change the names of the
paths, say:

* when user goes to http://app1.com/ - {thesamewebapp}/app1 path is served
as root path of the domain app1.com
* when user goes to http://app2.com/ - {thesamewebapp}/app2 path is served
as root path of the domain app2.com



 From this I conclude that the explicit requirement is to have a single
running version of the war, that responds to different domains. You
seem to think that you have an additional implicit requirement that
this must be done within tomcat by having different contexts. This
seems to me to be the source of confusion in all the replies to your
thread.


actually it would only be more convenient to do this with just tomcat.
but i would like to know any methods that solve the problem.





What you are trying to do is make the same webapp answer both
domain1.com/ and domain2.com/ right? If so you can simply
deploy the webapp as ROOT. The webapp will then answer on all domains
pointing to the server. If this is not what you want, you
can set up a virtual host in server.xml with an appbase outside the
webapps folder (eg. $CATALINA_BASE (or is it HOME?)$\domain1
and then use the Alias element to specify the second domain as an alias
for the first (which you set as an attribute in the
Host element).



i know these tricks, but they don't work for my case.


To my mind if you deploy the app as ROOT.war, as long as DNS is
configured correctly, that single context will serve responses to
http://app1.com/ and http://app2.com/. This appears solves the
explicit requirement stated above. However you state they don't work
for my case - please explain why this doesn't work for your case


in this case http://app1.com/ and http://app2.com/ will serve the same content.
i need different content on different domains.



Thanks

Chris

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



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



Re: Different webapp paths on different hosts

2013-01-26 Thread bxqdev



On 1/26/2013 9:36 PM, Caldarale, Charles R wrote:

From: cjder...@gmail.com [mailto:cjder...@gmail.com] On Behalf Of chris derham
Subject: Re: Different webapp paths on different hosts



To my mind if you deploy the app as ROOT.war, as long as DNS is
configured correctly, that single context will serve responses to
http://app1.com/ and http://app2.com/. This appears solves the
explicit requirement stated above.


Which is what I suggested back on 23 January:


Assuming path1.com and path2.com evaluate to the same IP address (or
at least to the same system), this will happen automatically with a
single Host element in the Tomcat configuration.


But the OP refuses to supply any information about why that's not sufficient.

  - Chuck


in this case http://app1.com/ and http://app2.com/ will serve the same content.
i need different content on different domains.




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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



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



RE: Different webapp paths on different hosts

2013-01-26 Thread Caldarale, Charles R
 From: bxqdev [mailto:bxq...@themailbay.com] 
 Subject: Re: Different webapp paths on different hosts

 in this case http://app1.com/ and http://app2.com/ will serve the same 
 content.
 i need different content on different domains.

First you state that you want the same webapp to serve both domains, and now 
you state that you want different content for each domain.  If you really want 
to do that, the single webapp will have to decide what content to deliver based 
on the request URL.

If you don't want to put that logic in the webapp, you will need a separate 
webapp for each domain, with a Host element for each domain.

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Different webapp paths on different hosts

2013-01-25 Thread Casper Wandahl Schmidt

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 25-01-2013 06:38, bxqdev skrev:



On 1/24/2013 11:52 AM, Casper Wandahl Schmidt wrote:

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 24-01-2013 02:32, Christopher Schultz skrev:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

BBQ,

On 1/23/13 12:09 AM, bxqdev wrote:

i need to map a custom paths, like /path1 and /path2, (not root
/ path), of the same webapp to a custom domains.

as i said i need this mapping: ${samewebapp}/path1 is mapped to
http://path1.com/ ${samewebapp}/path2 is mapped to
http://path2.com/

NOT this: ${samewebapp}/path1 is mapped to http://path1.com/path1
${samewebapp}/path2 is mapped to http://path2.com/path2

What is ${samewebpp}/path1? Is that a piece of a webapp?

Do you care if the same webapp is deployed twice (which is probably
going to be required)?
Actually the OP is not really clear in describing anything. I'm 
wondering if path1 in http://path1.com equals path1 in the

/path1 part or not.


actually the path names and domain names should be able to be different



Anyway I would say a context.xml file in conf/catalina/path1 (the 
hostname)/path1.xml (the context name) should do the trick?
Place the webapp outside the appbase of the hosts and then point the 
docbase to the webapp (or just drop the .war with two

different names in the appbases of the two hosts) :)


i want to have one instance of webapp,
which has two paths,
and each of the paths serves the root of different domains

once again:
* one webapp
* has 2 different paths: /path1 and /path2
* served on 2 domains
* when user goes to http://path1.com/ - {webapp}/path1 is served as 
root path
* when user goes to http://path2.com/ - {webapp}/path2 is served as 
root path


is it possible?
To me it doesn't make sense to say that the webapp has two different 
paths, /path1 and path2, and then say the webapp is to be served as root 
from two different hosts. I guess it's simply a case of bad terminology :)


Anyway. What you are trying to do is make the same webapp answer both 
domain1.com/ and domain2.com/ right? If so you can simply deploy the 
webapp as ROOT. The webapp will then answer on all domains pointing to 
the server. If this is not what you want, you can set up a virtual host 
in server.xml with an appbase outside the webapps folder (eg. 
$CATALINA_BASE (or is it HOME?)$\domain1 and then use the Alias 
element to specify the second domain as an alias for the first (which 
you set as an attribute in the Host element).




- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAj0cACgkQ9CaO5/Lv0PCChwCggGZi3v8ylGaj6py+uQ2ZNuq9
0+QAnR5ENaqoollzjpB5dx7KtcT3mquu
=/GYF
-END PGP SIGNATURE-

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




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



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




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



Re: Different webapp paths on different hosts

2013-01-25 Thread Konstantin Kolinko
2013/1/25 bxqdev bxq...@themailbay.com:

 Anyway I would say a context.xml file in conf/catalina/path1 (the
 hostname)/path1.xml (the context name) should do the trick?
 Place the webapp outside the appbase of the hosts and then point the
 docbase to the webapp (or just drop the .war with two
 different names in the appbases of the two hosts) :)


 i want to have one instance of webapp,
 which has two paths,
 and each of the paths serves the root of different domains

 once again:
 * one webapp
 * has 2 different paths: /path1 and /path2
 * served on 2 domains
 * when user goes to http://path1.com/ - {webapp}/path1 is served as root
 path
 * when user goes to http://path2.com/ - {webapp}/path2 is served as root
 path

 is it possible?


Two different instances of the same webapp at different hosts - easy.
E.g. the manager webapp is deployed in such way to the virtual hosts.

One instance mapped to different paths - impossible. What value should
be returned by javax.servlet.ServletContext.getContextPath() ?

Thought it is possible to apply urlrewriting, either at HTTPD or at Tomcat.

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



Re: Different webapp paths on different hosts

2013-01-25 Thread Shanti Suresh
On Fri, Jan 25, 2013 at 3:29 AM, Konstantin Kolinko
knst.koli...@gmail.comwrote:

 2013/1/25 bxqdev bxq...@themailbay.com:
 
  Anyway I would say a context.xml file in conf/catalina/path1 (the
  hostname)/path1.xml (the context name) should do the trick?
  Place the webapp outside the appbase of the hosts and then point the
  docbase to the webapp (or just drop the .war with two
  different names in the appbases of the two hosts) :)
 


When we do this method, a separate web-application is spawned for each
context.  The common web-application and also all it's jars are not
shared.  You would need to adjust PermGen - basically hike it up
appropriately.  We have a similar situation.  We used this approach of
putting webapp outside appbase and pointing docbase to it for each context
within individual context.xml files.  The reason we did this was because we
have another default webapp serving as the root context.  This is a
solution we would like to avoid.

I would like to seek advice on how we might use a non-default webapp
serving multiple contexts, but yet have a single copy of the application's
classes and it's libraries being loaded into PermGen.


 
  i want to have one instance of webapp,
  which has two paths,
  and each of the paths serves the root of different domains
 
  once again:
  * one webapp
  * has 2 different paths: /path1 and /path2
  * served on 2 domains
  * when user goes to http://path1.com/ - {webapp}/path1 is served as
 root
  path
  * when user goes to http://path2.com/ - {webapp}/path2 is served as
 root
  path
 
  is it possible?
 

 Two different instances of the same webapp at different hosts - easy.
 E.g. the manager webapp is deployed in such way to the virtual hosts.


Sorry, I'm not understanding what you propose.  Would this method also
share the application and all classes among the different contexts?

One instance mapped to different paths - impossible. What value should
 be returned by javax.servlet.ServletContext.getContextPath() ?




 Thought it is possible to apply urlrewriting, either at HTTPD or at Tomcat.


I have wanted to try this way out but haven't gotten around to it.  I
believe this method would share a single copy of the non-default web
application, am I correct?

Thanks!

   -Shanti


Re: Different webapp paths on different hosts

2013-01-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Dude,

On 1/25/13 12:38 AM, bxqdev wrote:
 i want to have one instance of webapp,

No problem.

 which has two paths,

Problem: one context = one path = one instance

If you want two separate paths, you need two separate contexts.

 and each of the paths serves the root of different domains

That just doesn't make any sense. The root of a domain is, by
definition, / (contextPath=), so there aren't any other paths to
consider.

 once again: * one webapp * has 2 different paths: /path1 and
 /path2 * served on 2 domains * when user goes to
 http://path1.com/ - {webapp}/path1 is served as root path * when
 user goes to http://path2.com/ - {webapp}/path2 is served as root
 path
 
 is it possible?

What you are saying is nonsensical (specifically, the part where you
say that you want /path1 to be mapped to root.

If you want two virtual hosts, then define two virtual hosts. If you
want an app on each host configured as ROOT, then make your two
virtual hosts have two separate appBase directories (which should be a
requirement in the first place of two virtual hosts) and toss a copy
of your WAR file in each appBase, both named ROOT.war (cApITaLS matter).

You can't deploy a single copy (in memory) of your webapp and expect
to get all your requirements above met. If you want to have a single
WAR file on the disk and deploy it multiple times, you *can* do that
but I'm not sure why anyone would want to.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEC85cACgkQ9CaO5/Lv0PCsDACfYWSxsHAgIoFRDWPNGd+O3FvN
mtsAnji32K1aEfpIZPv0gRQWgvoV4Hnc
=RC5B
-END PGP SIGNATURE-

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



Re: Different webapp paths on different hosts

2013-01-25 Thread bxqdev



On 1/25/2013 12:11 PM, Casper Wandahl Schmidt wrote:

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 25-01-2013 06:38, bxqdev skrev:



On 1/24/2013 11:52 AM, Casper Wandahl Schmidt wrote:

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 24-01-2013 02:32, Christopher Schultz skrev:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

BBQ,

On 1/23/13 12:09 AM, bxqdev wrote:

i need to map a custom paths, like /path1 and /path2, (not root
/ path), of the same webapp to a custom domains.

as i said i need this mapping: ${samewebapp}/path1 is mapped to
http://path1.com/ ${samewebapp}/path2 is mapped to
http://path2.com/

NOT this: ${samewebapp}/path1 is mapped to http://path1.com/path1
${samewebapp}/path2 is mapped to http://path2.com/path2

What is ${samewebpp}/path1? Is that a piece of a webapp?

Do you care if the same webapp is deployed twice (which is probably
going to be required)?

Actually the OP is not really clear in describing anything. I'm wondering if path1 in 
http://path1.com equals path1 in the
/path1 part or not.


actually the path names and domain names should be able to be different



Anyway I would say a context.xml file in conf/catalina/path1 (the 
hostname)/path1.xml (the context name) should do the trick?
Place the webapp outside the appbase of the hosts and then point the docbase to 
the webapp (or just drop the .war with two
different names in the appbases of the two hosts) :)


i want to have one instance of webapp,
which has two paths,
and each of the paths serves the root of different domains

once again:
* one webapp
* has 2 different paths: /path1 and /path2
* served on 2 domains
* when user goes to http://path1.com/ - {webapp}/path1 is served as root path
* when user goes to http://path2.com/ - {webapp}/path2 is served as root path

is it possible?

To me it doesn't make sense to say that the webapp has two different paths, 
/path1 and path2, and then say the webapp is to be
served as root from two different hosts. I guess it's simply a case of bad 
terminology :)


it's not. maybe it will make things clear if i change the names of the paths, 
say:

* when user goes to http://app1.com/ - {thesamewebapp}/app1 path is served as 
root path of the domain app1.com
* when user goes to http://app2.com/ - {thesamewebapp}/app2 path is served as 
root path of the domain app2.com



Anyway. What you are trying to do is make the same webapp answer both 
domain1.com/ and domain2.com/ right? If so you can simply
deploy the webapp as ROOT. The webapp will then answer on all domains pointing 
to the server. If this is not what you want, you
can set up a virtual host in server.xml with an appbase outside the webapps 
folder (eg. $CATALINA_BASE (or is it HOME?)$\domain1
and then use the Alias element to specify the second domain as an alias for 
the first (which you set as an attribute in the
Host element).


i know these tricks, but they don't work for my case.





- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAj0cACgkQ9CaO5/Lv0PCChwCggGZi3v8ylGaj6py+uQ2ZNuq9
0+QAnR5ENaqoollzjpB5dx7KtcT3mquu
=/GYF
-END PGP SIGNATURE-

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




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



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




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



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



Re: Different webapp paths on different hosts

2013-01-25 Thread bxqdev



On 1/25/2013 12:29 PM, Konstantin Kolinko wrote:

2013/1/25 bxqdev bxq...@themailbay.com:


Anyway I would say a context.xml file in conf/catalina/path1 (the
hostname)/path1.xml (the context name) should do the trick?
Place the webapp outside the appbase of the hosts and then point the
docbase to the webapp (or just drop the .war with two
different names in the appbases of the two hosts) :)



i want to have one instance of webapp,
which has two paths,
and each of the paths serves the root of different domains

once again:
* one webapp
* has 2 different paths: /path1 and /path2
* served on 2 domains
* when user goes to http://path1.com/ - {webapp}/path1 is served as root
path
* when user goes to http://path2.com/ - {webapp}/path2 is served as root
path

is it possible?



Two different instances of the same webapp at different hosts - easy.
E.g. the manager webapp is deployed in such way to the virtual hosts.

One instance mapped to different paths - impossible. What value should
be returned by javax.servlet.ServletContext.getContextPath() ?

Thought it is possible to apply urlrewriting, either at HTTPD or at Tomcat.


looks like url rewriting is the only way. though i was wondering if it's 
possible to do the trick with tomcat configuration.



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



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



Re: Different webapp paths on different hosts

2013-01-25 Thread bxqdev



On 1/26/2013 1:05 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Dude,

On 1/25/13 12:38 AM, bxqdev wrote:

i want to have one instance of webapp,


No problem.


which has two paths,


Problem: one context = one path = one instance

If you want two separate paths, you need two separate contexts.


and each of the paths serves the root of different domains


That just doesn't make any sense. The root of a domain is, by
definition, / (contextPath=), so there aren't any other paths to
consider.


looks like the goal is not reachable with plain tomcat configuration.




once again: * one webapp * has 2 different paths: /path1 and
/path2 * served on 2 domains * when user goes to
http://path1.com/ - {webapp}/path1 is served as root path * when
user goes to http://path2.com/ - {webapp}/path2 is served as root
path

is it possible?


What you are saying is nonsensical (specifically, the part where you
say that you want /path1 to be mapped to root.

If you want two virtual hosts, then define two virtual hosts. If you
want an app on each host configured as ROOT, then make your two
virtual hosts have two separate appBase directories (which should be a
requirement in the first place of two virtual hosts) and toss a copy
of your WAR file in each appBase, both named ROOT.war (cApITaLS matter).

You can't deploy a single copy (in memory) of your webapp and expect
to get all your requirements above met. If you want to have a single
WAR file on the disk and deploy it multiple times, you *can* do that
but I'm not sure why anyone would want to.


looks like the goal is not reachable with plain tomcat configuration.



- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEC85cACgkQ9CaO5/Lv0PCsDACfYWSxsHAgIoFRDWPNGd+O3FvN
mtsAnji32K1aEfpIZPv0gRQWgvoV4Hnc
=RC5B
-END PGP SIGNATURE-

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



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



Re: Different webapp paths on different hosts

2013-01-24 Thread bxqdev



On 1/24/2013 5:32 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

BBQ,

On 1/23/13 12:09 AM, bxqdev wrote:

i need to map a custom paths, like /path1 and /path2, (not root
/ path), of the same webapp to a custom domains.

as i said i need this mapping: ${samewebapp}/path1 is mapped to
http://path1.com/ ${samewebapp}/path2 is mapped to
http://path2.com/

NOT this: ${samewebapp}/path1 is mapped to http://path1.com/path1
${samewebapp}/path2 is mapped to http://path2.com/path2


What is ${samewebpp}/path1? Is that a piece of a webapp?


yes, paths are the parts of one webapp



Do you care if the same webapp is deployed twice (which is probably
going to be required)?


i want to have one instance of webapp,
which has two paths,
and each of the paths servers the root of different domains

is it possible?



- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAj0cACgkQ9CaO5/Lv0PCChwCggGZi3v8ylGaj6py+uQ2ZNuq9
0+QAnR5ENaqoollzjpB5dx7KtcT3mquu
=/GYF
-END PGP SIGNATURE-

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



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



Re: Different webapp paths on different hosts

2013-01-24 Thread bxqdev



On 1/24/2013 11:52 AM, Casper Wandahl Schmidt wrote:

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 24-01-2013 02:32, Christopher Schultz skrev:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

BBQ,

On 1/23/13 12:09 AM, bxqdev wrote:

i need to map a custom paths, like /path1 and /path2, (not root
/ path), of the same webapp to a custom domains.

as i said i need this mapping: ${samewebapp}/path1 is mapped to
http://path1.com/ ${samewebapp}/path2 is mapped to
http://path2.com/

NOT this: ${samewebapp}/path1 is mapped to http://path1.com/path1
${samewebapp}/path2 is mapped to http://path2.com/path2

What is ${samewebpp}/path1? Is that a piece of a webapp?

Do you care if the same webapp is deployed twice (which is probably
going to be required)?

Actually the OP is not really clear in describing anything. I'm wondering if path1 in 
http://path1.com equals path1 in the
/path1 part or not.


actually the path names and domain names should be able to be different



Anyway I would say a context.xml file in conf/catalina/path1 (the 
hostname)/path1.xml (the context name) should do the trick?
Place the webapp outside the appbase of the hosts and then point the docbase to 
the webapp (or just drop the .war with two
different names in the appbases of the two hosts) :)


i want to have one instance of webapp,
which has two paths,
and each of the paths serves the root of different domains

once again:
* one webapp
* has 2 different paths: /path1 and /path2
* served on 2 domains
* when user goes to http://path1.com/ - {webapp}/path1 is served as root path
* when user goes to http://path2.com/ - {webapp}/path2 is served as root path

is it possible?



- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAj0cACgkQ9CaO5/Lv0PCChwCggGZi3v8ylGaj6py+uQ2ZNuq9
0+QAnR5ENaqoollzjpB5dx7KtcT3mquu
=/GYF
-END PGP SIGNATURE-

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




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



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



RE: Different webapp paths on different hosts

2013-01-23 Thread Jeffrey Janner


 -Original Message-
 From: bxqdev [mailto:bxq...@themailbay.com]
 Sent: Tuesday, January 22, 2013 11:09 PM
 To: Tomcat Users List
 Subject: Re: Different webapp paths on different hosts
 
 i need to map a custom paths, like /path1 and /path2, (not root /
 path), of the same webapp to a custom domains.
 
 as i said i need this mapping:
 ${samewebapp}/path1 is mapped to http://path1.com/
 ${samewebapp}/path2 is mapped to http://path2.com/
 
 NOT this:
 ${samewebapp}/path1 is mapped to http://path1.com/path1
 ${samewebapp}/path2 is mapped to http://path2.com/path2
 
 custom paths of the same webapp should map to different root paths on
 different domains.
 
 thanks!
 
 

I haven't front-ended with Apache HTTPD in a long time, but could the OP do 
this using AJP?
Jeff


Re: Different webapp paths on different hosts

2013-01-23 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

BBQ,

On 1/23/13 12:09 AM, bxqdev wrote:
 i need to map a custom paths, like /path1 and /path2, (not root
 / path), of the same webapp to a custom domains.
 
 as i said i need this mapping: ${samewebapp}/path1 is mapped to
 http://path1.com/ ${samewebapp}/path2 is mapped to
 http://path2.com/
 
 NOT this: ${samewebapp}/path1 is mapped to http://path1.com/path1 
 ${samewebapp}/path2 is mapped to http://path2.com/path2

What is ${samewebpp}/path1? Is that a piece of a webapp?

Do you care if the same webapp is deployed twice (which is probably
going to be required)?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAj0cACgkQ9CaO5/Lv0PCChwCggGZi3v8ylGaj6py+uQ2ZNuq9
0+QAnR5ENaqoollzjpB5dx7KtcT3mquu
=/GYF
-END PGP SIGNATURE-

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



Re: Different webapp paths on different hosts

2013-01-23 Thread Casper Wandahl Schmidt

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 24-01-2013 02:32, Christopher Schultz skrev:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

BBQ,

On 1/23/13 12:09 AM, bxqdev wrote:

i need to map a custom paths, like /path1 and /path2, (not root
/ path), of the same webapp to a custom domains.

as i said i need this mapping: ${samewebapp}/path1 is mapped to
http://path1.com/ ${samewebapp}/path2 is mapped to
http://path2.com/

NOT this: ${samewebapp}/path1 is mapped to http://path1.com/path1
${samewebapp}/path2 is mapped to http://path2.com/path2

What is ${samewebpp}/path1? Is that a piece of a webapp?

Do you care if the same webapp is deployed twice (which is probably
going to be required)?
Actually the OP is not really clear in describing anything. I'm 
wondering if path1 in http://path1.com equals path1 in the /path1 
part or not.


Anyway I would say a context.xml file in conf/catalina/path1 (the 
hostname)/path1.xml (the context name) should do the trick? Place the 
webapp outside the appbase of the hosts and then point the docbase to 
the webapp (or just drop the .war with two different names in the 
appbases of the two hosts) :)


- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAj0cACgkQ9CaO5/Lv0PCChwCggGZi3v8ylGaj6py+uQ2ZNuq9
0+QAnR5ENaqoollzjpB5dx7KtcT3mquu
=/GYF
-END PGP SIGNATURE-

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




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



RE: Different webapp paths on different hosts

2013-01-22 Thread Caldarale, Charles R
 From: bxqdev [mailto:bxq...@themailbay.com] 
 Subject: Different webapp paths on different hosts

 Is it possible with tomcat to have one web app, with 2 different 
 paths on different hosts??

 I mean something like this:
 ${samewebapp}/path1 is mapped to http://path1.com/
 and
 ${samewebapp}/path2 is mapped to http://path2.com/

Assuming path1.com and path2.com evaluate to the same IP address (or at least 
to the same system), this will happen automatically with a single Host 
element in the Tomcat configuration.

Or did you really want to ask a different question?

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Different webapp paths on different hosts

2013-01-22 Thread bxqdev

i need to map a custom paths, like /path1 and /path2, (not root / path), 
of the same webapp to a custom domains.

as i said i need this mapping:
${samewebapp}/path1 is mapped to http://path1.com/
${samewebapp}/path2 is mapped to http://path2.com/

NOT this:
${samewebapp}/path1 is mapped to http://path1.com/path1
${samewebapp}/path2 is mapped to http://path2.com/path2

custom paths of the same webapp should map to different root paths on different 
domains.

thanks!


On 1/23/2013 8:58 AM, Caldarale, Charles R wrote:

From: bxqdev [mailto:bxq...@themailbay.com]
Subject: Different webapp paths on different hosts



Is it possible with tomcat to have one web app, with 2 different
paths on different hosts??



I mean something like this:
${samewebapp}/path1 is mapped to http://path1.com/
and
${samewebapp}/path2 is mapped to http://path2.com/


Assuming path1.com and path2.com evaluate to the same IP address (or at least to the 
same system), this will happen automatically with a single Host element in 
the Tomcat configuration.

Or did you really want to ask a different question?

  - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



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