You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thomas Hauk <th...@ualberta.net> on 2010/10/20 08:51:14 UTC

How does Tomcat on Mac OS X Server handle requests to different domain names?

I'm setting up a Mac OS X Server (10.5) machine, and that will include setting up Tomcat. The machine will be the host for at least two different domain names -- let's say myapp.example.com and myapp.anotherexample.com -- each of which will need to be hooked up to a different servlet. In other words, HTTP requests to http://myapp.example.com/ should get routed to the myappexample servlet, and HTTP requests to http://myapp.anotherexample.com/ should get routed to the myappanotherexample servlet.

How do I do this?

I've looked for a guide or tutorial but I haven't found anything. If you aren't sure how Mac OS X Server 10.5 works, that's okay; I'm willing to settle for a more general tutorial about setting up just the Tomcat side of things!

T

--
"A good programmer is someone who always looks both ways before crossing a one-way street."
  -- Doug Linder


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


Re: How does Tomcat on Mac OS X Server handle requests to different domain names?

Posted by Thomas Hauk <th...@ualberta.net>.
On Oct 21, 2010, at 1:06 AM, André Warnier wrote:
> Start here :
> 
> http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html
> 
>>> Use the special name 'ROOT' for each application and it will serve
>>> resource on the default path.
>> Can you describe this in more detail?
> 
> Start here :
> 
> http://wiki.apache.org/tomcat/HowTo
> 
> at #39

Thanks, André!

Mostly, now I think I have everything working, although I'm getting an InternalError exception upon a certain operation. I'll start a new thread for that.

T

--
"If you wish to make an apple pie from scratch, you must first invent the universe"
  -- Carl Sagan


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


Re: How does Tomcat on Mac OS X Server handle requests to different domain names?

Posted by André Warnier <aw...@ice-sa.com>.
Thomas Hauk wrote:
> On Oct 20, 2010, at 3:22 AM, Pid wrote:
>> Presumably by 'different servlet' you mean different 'web application
>> which contains one or more servlets'?
> 
> I'm not sure what kind of distinction you're trying to get at here, so let me phrase what I need in another way.
> 
> I have brandedapp1.war and brandedapp2.war that I want to deploy to Tomcat.
> 
> brandedapp1 should respond to all requests sent to http://myapp.example.com/ and brandedapp2 should respond to all requests sent to http://myapp.anotherexample.com/ 
> 
> Assume that the DNS is already set up for myapp.example.com and myapp.anotherexample.com (i.e. both FQDNs point to my server's IP address)
> 
>> You'll need to configure DNS to point name records at the public IP
>> address of the server,
> 
> Already done.
> 
>> and once you've done that configure Tomcat to
>> support Virtual Hosts.
> 
> Can you describe this in more detail?

Start here :

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

> 
>> Use the special name 'ROOT' for each application and it will serve
>> resource on the default path.
> 
> Can you describe this in more detail?
> 

Start here :

http://wiki.apache.org/tomcat/HowTo

at #39



> T
> 
> --
> "Live every week like it's Shark Week"
>   -- Tracy Morgan
> 
> 
> ---------------------------------------------------------------------
> 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: How does Tomcat on Mac OS X Server handle requests to different domain names?

Posted by Thomas Hauk <th...@ualberta.net>.
On Oct 20, 2010, at 3:22 AM, Pid wrote:
> Presumably by 'different servlet' you mean different 'web application
> which contains one or more servlets'?

I'm not sure what kind of distinction you're trying to get at here, so let me phrase what I need in another way.

I have brandedapp1.war and brandedapp2.war that I want to deploy to Tomcat.

brandedapp1 should respond to all requests sent to http://myapp.example.com/ and brandedapp2 should respond to all requests sent to http://myapp.anotherexample.com/ 

Assume that the DNS is already set up for myapp.example.com and myapp.anotherexample.com (i.e. both FQDNs point to my server's IP address)

> You'll need to configure DNS to point name records at the public IP
> address of the server,

Already done.

> and once you've done that configure Tomcat to
> support Virtual Hosts.

Can you describe this in more detail?

> Use the special name 'ROOT' for each application and it will serve
> resource on the default path.

Can you describe this in more detail?

T

--
"Live every week like it's Shark Week"
  -- Tracy Morgan


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


Re: How does Tomcat on Mac OS X Server handle requests to different domain names?

Posted by Pid <pi...@pidster.com>.
On 20/10/2010 07:51, Thomas Hauk wrote:
> I'm setting up a Mac OS X Server (10.5) machine, and that will include setting up Tomcat. 

The machine will be the host for at least two different domain names --
let's say myapp.example.com

and myapp.anotherexample.com -- each of which will need to be hooked up
to a different servlet.

In other words, HTTP requests to http://myapp.example.com/ should get
routed to the

myappexample servlet, and HTTP requests to
http://myapp.anotherexample.com/ should get routed

to the myappanotherexample servlet.
> 
> How do I do this?

Presumably by 'different servlet' you mean different 'web application
which contains one or more servlets'?

You'll need to configure DNS to point name records at the public IP
address of the server, and once you've done that configure Tomcat to
support Virtual Hosts.

Use the special name 'ROOT' for each application and it will serve
resource on the default path.

> I've looked for a guide or tutorial but I haven't found anything. If you aren't sure how Mac OS X Server 10.5 works, that's okay; I'm willing to settle for a more general tutorial about setting up just the Tomcat side of things! 

The tomcat.apache.org site has docs on how to do the Tomcat bit.
I don't think there's anything special you'll need to do to OSX.


p

> T
> 
> --
> "A good programmer is someone who always looks both ways before crossing a one-way street."
>   -- Doug Linder
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>