Re: How to Map domain to a context using Mod_jk

2009-10-06 Thread Pid Ster
On 6 Oct 2009, at 05:56, gpike gop...@gmail.com wrote:


 I have Virtual Hosts defined in Apache for each domain. I want to
 map the
 domain to a context in Tomcat. For instance I would like mysite.com
 to map
 to /mysite_com in Tomcat. Would it be something like:

 VirtualHost *:80
ServerName mysite.com
RewriteRule ^/(.*)$ /mysite_com/$1 [PT]
JkMount /mysite_com/* worker1
 /VirtualHost

 Is there a better way?

You mean is there a way to achieve the above with Tomcat?

Yes: define a default or ROOT context for each host. Tomcat docs site
has plenty of info on virtual hosts and setting up web application
contexts.

p

 Thanks Gordon
 --
 View this message in context: 
 http://www.nabble.com/How-to-Map-domain-to-a-context-using-Mod_jk-tp25762921p25762921.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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: How to Map domain to a context using Mod_jk

2009-10-06 Thread Rainer Jung
On 06.10.2009 06:56, gpike wrote:
 
 I have Virtual Hosts defined in Apache for each domain. I want to map the
 domain to a context in Tomcat. For instance I would like mysite.com to map
 to /mysite_com in Tomcat. Would it be something like: 
 
 VirtualHost *:80
 ServerName mysite.com
 RewriteRule ^/(.*)$ /mysite_com/$1 [PT]
 JkMount /mysite_com/* worker1
 /VirtualHost
 
 Is there a better way?
 
 Thanks Gordon

If you already have contexts like mysite_com and you have reasons for
adding httpd and mod_jk, then yes, that would be the way to go.

The RewriteRule is a bit underspecified though, it would also apply to
URLs, which already start with /mysite_com/. You can use RewriteCond
with a ! to check against not starting with /mysite_com/.

You miht run into trouble with cookies and redirects. Have a look at

http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html#URL
Rewriting

concerning more info about those.

Regards,

Rainer

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



Re: How to Map domain to a context using Mod_jk

2009-10-06 Thread gpike

I want to be able to add new domains without restarting Tomcat. In tomcat
adding a VirtualHost would require a restart. I believe I can add a
VirtualHost in Apache without a restart. If I could redirect that to a
webapp context in Tomcat I think I can add those without a restart. Is that
the way to accomplish that?


Pid Ster wrote:
 
 On 6 Oct 2009, at 05:56, gpike gop...@gmail.com wrote:
 

 I have Virtual Hosts defined in Apache for each domain. I want to
 map the
 domain to a context in Tomcat. For instance I would like mysite.com
 to map
 to /mysite_com in Tomcat. Would it be something like:

 VirtualHost *:80
ServerName mysite.com
RewriteRule ^/(.*)$ /mysite_com/$1 [PT]
JkMount /mysite_com/* worker1
 /VirtualHost

 Is there a better way?
 
 You mean is there a way to achieve the above with Tomcat?
 
 Yes: define a default or ROOT context for each host. Tomcat docs site
 has plenty of info on virtual hosts and setting up web application
 contexts.
 
 p
 
 Thanks Gordon
 --
 View this message in context:
 http://www.nabble.com/How-to-Map-domain-to-a-context-using-Mod_jk-tp25762921p25762921.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-Map-domain-to-a-context-using-Mod_jk-tp25762921p25768966.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: How to Map domain to a context using Mod_jk

2009-10-06 Thread Caldarale, Charles R
 From: gpike [mailto:gop...@gmail.com]
 Subject: Re: How to Map domain to a context using Mod_jk
 
 In tomcat adding a VirtualHost would require a restart.

Not true; use the supplied host-manager (not manager) webapp to manipulate 
Host entries on the fly.  The only caveat is that it does not update 
server.xml, so you would need to do that separately, or always use host-manager 
to create the virtual hosts after a restart.

 - 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: How to Map domain to a context using Mod_jk

2009-10-06 Thread gpike

Really great. So just so I understand, I want to host users sites where they
have their own domain. I want to be able to deploy their webapp, for their
domain in my server without the restarting the Tomcat server. I also want to
automate the process.

  I thought a restart was needed because VirtualHost config is in the
server.xml. So are you saying using  host-manager I could add the new
VirtualHost, but I would also need to add it to server.xml because the
host-manager changes would be lost at restart?

  If so that would make everything simpler. Thanks. 



Caldarale, Charles R wrote:
 
 From: gpike [mailto:gop...@gmail.com]
 Subject: Re: How to Map domain to a context using Mod_jk
 
 In tomcat adding a VirtualHost would require a restart.
 
 Not true; use the supplied host-manager (not manager) webapp to manipulate
 Host entries on the fly.  The only caveat is that it does not update
 server.xml, so you would need to do that separately, or always use
 host-manager to create the virtual hosts after a restart.
 
  - 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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/How-to-Map-domain-to-a-context-using-Mod_jk-tp25762921p25770177.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



RE: How to Map domain to a context using Mod_jk

2009-10-06 Thread Caldarale, Charles R
 From: gpike [mailto:gop...@gmail.com]
 Subject: RE: How to Map domain to a context using Mod_jk
 
 I thought a restart was needed because VirtualHost config is in the
 server.xml.

Tomcat has APIs for pretty much everything, and these are used by the parser 
for server.xml to create the internal objects, including those for each Host. 
 The host-manager webapp does the same.

 So are you saying using  host-manager I could add the new
 VirtualHost, but I would also need to add it to server.xml
 because the host-manager changes would be lost at restart?

Adding it to server.xml is one way; you could also keep track of the additional 
hosts separately and just call the host-manager webapp with the necessary data 
to add each one at Tomcat startup.

 - 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