Josh,
The second .com would just be another Host entry in server.xml. Don't
forget to add any Context configs in conf/Catalina/www.<second
domain>.com just like your first domain.
As far as forwarding the .net to the .com, there are two ways of doing
that. If Tomcat is fronted by Apache httpd, you'll want something like:
<VirtualHost *>
ServerName www.<your domain>.net
Redirect permanent / http://www.<your domain>.com/
</VirtualHost>
in your httpd.conf. If you use this method Tomcat doesn't need to know
about the .net side at all.
If you're not using Apache, a simple way to do it is to create an
index.jsp in the .net appBase that does something like:
<%
response.sendRedirect( response.encodeRedirectURL( "http://www.<your
domain>.com/" ) );
%>
This, however, doesn't correctly handle a redirect from something like
http://www.<your domain>.net/blah/blah/blah to http://www.<your
domain>.com/blah/blah/blah. To do it "correctly" I would implement a
"global" (matching the URL /*) filter on the <your domain>.net side that
sends a redirect to the .com side.
Lastly, it is possible to add any number of Alias entries within a Host
container. The upside is that it is very easy - have the Host name be
"www.<your domain>.com" and an Alias entry for "<your domain>.com",
"www.<your domain>.net" and "<your domain>.net". The downside is that
your site will look and behave exactly the same for any of these host
names. There may be SEO issues associated with having 4 host names look
exactly the same though I'll admit I'm not positive of this.
Josh Gooding wrote:
My Tomcat configuration as of right now is set to serve on a .com domain. I
recently bought 2 more domains and want to host a different .com but use the
same installation of tomcat that I am using currently. Is this just another
<Host> declaration or would I need another <Engine>declaration? Also what
about forwarding from .net to .com, is it the same thing?
Thanks in advance
- Josh
--
Scott Dunbar
Xigole Systems, Inc.
Enterprise consulting, development, and hosting
303·667·6343