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

Reply via email to