RE: Wildcard virtual hosts help

2004-07-20 Thread Gary Evesson
 -Original Message-
 From: Cott Lang [mailto:[EMAIL PROTECTED]
 Sent: Monday, July 19, 2004 10:14 PM
 To: Tomcat Users List
 Subject: RE: Wildcard virtual hosts help
 
 Thanks, Gary.  I thought of that as a possibility over the weekend while
 mulling over Daniel's suggestion, but have not had a chance to try it. I
 appreciate knowing someone else has it working. :)
 

Drop me an email if you want to look at some example rules. It can be a bit
fiddly to get set up initially...

Gary Evesson
Decentrix Inc


smime.p7s
Description: S/MIME cryptographic signature


RE: Wildcard virtual hosts help

2004-07-19 Thread Gary Evesson
 -Original Message-
 From: Cott Lang [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 15, 2004 2:11 PM
 To: Tomcat Users List
 Subject: Wildcard virtual hosts help

 I have a specific problem that requires that I map hundreds of thousands
 (yes, hundreds of thousands) of domain names to a dozen or so different
 web-apps based on domain name. I currently use Resin to handle this, but
 really wish to abandon Resin for Tomcat for a variety of reasons.
 I would immensely appreciate it if anyone could point me in the
 direction of how to implement something like:


I have done this with re-write rules in apache by forcing the domain names
into a common path that will then execute in the application context that I
want. I always use the default host in tomcat...

It is not the most elegant solution, but it *does* work. The advantage with
this approach is that new domains can be added without restarting anything.

Gary Evesson
Decentrix Inc.


smime.p7s
Description: S/MIME cryptographic signature


RE: Wildcard virtual hosts help

2004-07-19 Thread Cott Lang
Thanks, Gary.  I thought of that as a possibility over the weekend while
mulling over Daniel's suggestion, but have not had a chance to try it. I
appreciate knowing someone else has it working. :)

Thanks,
Cott


 I have done this with re-write rules in apache by forcing the domain names
 into a common path that will then execute in the application context that I
 want. I always use the default host in tomcat...
 
 It is not the most elegant solution, but it *does* work. The advantage with
 this approach is that new domains can be added without restarting anything.
 
 Gary Evesson
 Decentrix Inc.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wildcard virtual hosts help

2004-07-16 Thread Ronald Klop
You can use a default host if I remember correct.
All hosts which don't have there own mapping will be handled by the default host.
Ronald.
On Thu Jul 15 22:11:03 CEST 2004 Cott Lang [EMAIL PROTECTED] wrote:

I have a specific problem that requires that I map hundreds of thousands
(yes, hundreds of thousands) of domain names to a dozen or so different
web-apps based on domain name. I currently use Resin to handle this, but
really wish to abandon Resin for Tomcat for a variety of reasons.
Uniquely defining each one as a web app isn't practical due to the sheer
number involved, and the fact that hundreds of domain names come and go
during the day.
I've googled and searched the archives, and I can't seem to find an
answer to how to do this with Tomcat 5, if it's even possible. I've seen
several people asked, and the only one I found a number of responses to
was chided for his decision to use wildcards. :)
I would immensely appreciate it if anyone could point me in the
direction of how to implement something like:
Host name='*.mydomain.com'
(which I've tried to no avail)
thanks!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wildcard virtual hosts help

2004-07-16 Thread Daniel J. Obregon
What I'm thinking here is using a virtual host within an apache
configuration file:

*** With apache 2 (not sure if it's in apache 1.3x) you can have
virtual hosts defined in separate files and then include them in the
main httpd.conf file by saying Include path/to/foo.conf.  Apache 1.3
will let you include virtual hosts in the main httpd.conf file.

VirtualHost 1.2.3.4:80
   DirectoryIndex index.html index.jsp index.php
   ServerAdmin [EMAIL PROTECTED]
   DocumentRoot /usr/local/tomcat/webapps/App1
   ServerName foo.mydomain.com
   ServerAlias bar.mydomain.com
   ErrorLog logs/App1.error.log
   CustomLog logs/App1.access.log common
/VirtualHost

VirtualHost 1.2.3.4:80
   DirectoryIndex index.html index.jsp index.php
   ServerAdmin [EMAIL PROTECTED]
   DocumentRoot /usr/local/tomcat/webapps/App2
   ServerName foo2.mydomain.com
   ServerAlias bar2.mydomain.com
   ErrorLog logs/App2.error.log
   CustomLog logs/App2.access.log common
/VirtualHost

Again, this is just the approach I would take to map several domains to
the webapps.  I know you said it was thousands, which is why i thought
using a script to generate the virtual host config files would be a
possible solution.

- Dan -

 On Thu, 2004-07-15 at 13:15, Daniel J. Obregon wrote:
 Have you considered using apache/mod_jk?

 If you are mapping thousands of domains to a few webapps, it might be
 better to use apache.  Then, *worst* case you can write a script to
 generate and/or maintain a set of virtual hosts

 Actually, I am using Apache/mod_jk. How does that help me map domains to
 particular webapps ?  I hope I'm missing something simple. ;)

 thanks!



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wildcard virtual hosts help

2004-07-16 Thread Cott Lang
I can't see how that would work (and it doesn't seem to), because while
Apache points at the right app directory, any request coming into Tomcat
that doesn't match an explicit host name goes to the default host, and
thus to a different app ...

i.e., I need to duplicate a config I have in Resin that maps: 

*.somedomain.com -- app1
*.otherdomain.com -- app2
*.yetanotherdomain.com -- app3

In Tomcat I've setup:

x.somedomain.com -- app1

but I can't figure out how to route *.somedomain.com -- app1

Resin handles this simply with a wildcard or regexp host string...

thanks!




On Fri, 2004-07-16 at 05:49, Daniel J. Obregon wrote:
 What I'm thinking here is using a virtual host within an apache
 configuration file:
 
 *** With apache 2 (not sure if it's in apache 1.3x) you can have
 virtual hosts defined in separate files and then include them in the
 main httpd.conf file by saying Include path/to/foo.conf.  Apache 1.3
 will let you include virtual hosts in the main httpd.conf file.
 
 VirtualHost 1.2.3.4:80
DirectoryIndex index.html index.jsp index.php
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /usr/local/tomcat/webapps/App1
ServerName foo.mydomain.com
ServerAlias bar.mydomain.com
ErrorLog logs/App1.error.log
CustomLog logs/App1.access.log common
 /VirtualHost
 
 VirtualHost 1.2.3.4:80
DirectoryIndex index.html index.jsp index.php
ServerAdmin [EMAIL PROTECTED]
DocumentRoot /usr/local/tomcat/webapps/App2
ServerName foo2.mydomain.com
ServerAlias bar2.mydomain.com
ErrorLog logs/App2.error.log
CustomLog logs/App2.access.log common
 /VirtualHost
 
 Again, this is just the approach I would take to map several domains to
 the webapps.  I know you said it was thousands, which is why i thought
 using a script to generate the virtual host config files would be a
 possible solution.
 
 - Dan -
 
  On Thu, 2004-07-15 at 13:15, Daniel J. Obregon wrote:
  Have you considered using apache/mod_jk?
 
  If you are mapping thousands of domains to a few webapps, it might be
  better to use apache.  Then, *worst* case you can write a script to
  generate and/or maintain a set of virtual hosts
 
  Actually, I am using Apache/mod_jk. How does that help me map domains to
  particular webapps ?  I hope I'm missing something simple. ;)
 
  thanks!
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wildcard virtual hosts help

2004-07-15 Thread Daniel J. Obregon
Have you considered using apache/mod_jk?

If you are mapping thousands of domains to a few webapps, it might be
better to use apache.  Then, *worst* case you can write a script to
generate and/or maintain a set of virtual hosts

Just a thought...

- Dan Obregon -

 I have a specific problem that requires that I map hundreds of thousands
 (yes, hundreds of thousands) of domain names to a dozen or so different
 web-apps based on domain name. I currently use Resin to handle this, but
 really wish to abandon Resin for Tomcat for a variety of reasons.

 Uniquely defining each one as a web app isn't practical due to the sheer
 number involved, and the fact that hundreds of domain names come and go
 during the day.

 I've googled and searched the archives, and I can't seem to find an
 answer to how to do this with Tomcat 5, if it's even possible. I've seen
 several people asked, and the only one I found a number of responses to
 was chided for his decision to use wildcards. :)

 I would immensely appreciate it if anyone could point me in the
 direction of how to implement something like:

 Host name='*.mydomain.com'

 (which I've tried to no avail)

 thanks!



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Wildcard virtual hosts help

2004-07-15 Thread Cott Lang
On Thu, 2004-07-15 at 13:15, Daniel J. Obregon wrote:
 Have you considered using apache/mod_jk?
 
 If you are mapping thousands of domains to a few webapps, it might be
 better to use apache.  Then, *worst* case you can write a script to
 generate and/or maintain a set of virtual hosts

Actually, I am using Apache/mod_jk. How does that help me map domains to
particular webapps ?  I hope I'm missing something simple. ;)

thanks!



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]