You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Josh Gooding <jo...@gmail.com> on 2009/09/27 05:02:16 UTC

Re: configuring multiple domain's and forwarding on Tomcat 6 questions.

Scott,

I have my Context config's in the META-INF folder of the first .com's
appBase directory.  It's under \appBase\META-INF.  Is this wrong?

There is no httpd involved in the system, only Tomcat (and I'm trying to
find the PECL dll's to get PHP to work ;) )

This should be all I have to add correct?

    <Host name="www.realissuesforrealpeople.com" appBase="d:/JGSite"
                unpackWARs="true" autoDeploy="true"
                xmlValidation="false" xmlNamespaceAware="false" />

- Josh

On Sat, Sep 26, 2009 at 10:20 PM, Scott Dunbar <sc...@xigole.com> wrote:

> 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
>

Re: configuring multiple domain's and forwarding on Tomcat 6 questions.

Posted by Josh Gooding <jo...@gmail.com>.
Then there must be something messed up with my domain and what it is
pointing to.  It has a different IP address than my server.  I pointed the
IP address of the domain to the static IP address of my server that I am
already running and serving on Tomcat.

Realistically I should be seeing something then, I think I might have to
call the company I got the domain from to get it pointing to the right
server IP.

On Sat, Sep 26, 2009 at 11:50 PM, Caldarale, Charles R <
Chuck.Caldarale@unisys.com> wrote:

> > From: Josh Gooding [mailto:josh.gooding@gmail.com]
> > Subject: Re: configuring multiple domain's and forwarding on Tomcat 6
> > questions.
> >
> > I have my Context config's in the META-INF folder of the first .com's
> > appBase directory.  It's under \appBase\META-INF.  Is this wrong?
>
> Probably.  In the above, is "appBase" an actual directory name, or is it
> referring to the value of the appBase attribute of the <Host> element?  I
> suspect it's the latter, in which case your structure should really be this:
>
> D:\JGSite\
>  ROOT\  (the default webapp for this <Host>)
>    (first-level .html files, such as index.html)
>    (other first-level resources)
>    WEB-INF\
>      web.xml  (containing servlet mappings for your webapp, etc.)
>      lib\  (containing webapp .jar files)
>      classes\  (containing webapp classes)
>    META-INF\
>      context.xml  (containing the <Context> element)
>
> You may deploy additional webapps for the <Host> at the same level as ROOT
> as either expanded directories or .war files.
>
> > This should be all I have to add correct?
> >     <Host name="www.realissuesforrealpeople.com" appBase="d:/JGSite"
> >                 unpackWARs="true" autoDeploy="true"
> >                 xmlValidation="false" xmlNamespaceAware="false" />
>
> You probably don't even have to add that.  If you have only one webapp for
> one domain, you can simply replace the default Tomcat ROOT webapp with your
> own.  If you don't want to disturb the webapps distributed with Tomcat, then
> an additional <Host> is one way to segregate your webapps from the standard
> ones.  For a production environment, you probably want to remove all of the
> Tomcat webapps other than manager.
>
>  - 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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: configuring multiple domain's and forwarding on Tomcat 6 questions.

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Josh Gooding [mailto:josh.gooding@gmail.com]
> Subject: Re: configuring multiple domain's and forwarding on Tomcat 6
> questions.
> 
> I have my Context config's in the META-INF folder of the first .com's
> appBase directory.  It's under \appBase\META-INF.  Is this wrong?

Probably.  In the above, is "appBase" an actual directory name, or is it referring to the value of the appBase attribute of the <Host> element?  I suspect it's the latter, in which case your structure should really be this:

D:\JGSite\
  ROOT\  (the default webapp for this <Host>)
    (first-level .html files, such as index.html)
    (other first-level resources)
    WEB-INF\
      web.xml  (containing servlet mappings for your webapp, etc.)
      lib\  (containing webapp .jar files)
      classes\  (containing webapp classes)
    META-INF\
      context.xml  (containing the <Context> element)

You may deploy additional webapps for the <Host> at the same level as ROOT as either expanded directories or .war files.

> This should be all I have to add correct?
>     <Host name="www.realissuesforrealpeople.com" appBase="d:/JGSite"
>                 unpackWARs="true" autoDeploy="true"
>                 xmlValidation="false" xmlNamespaceAware="false" />

You probably don't even have to add that.  If you have only one webapp for one domain, you can simply replace the default Tomcat ROOT webapp with your own.  If you don't want to disturb the webapps distributed with Tomcat, then an additional <Host> is one way to segregate your webapps from the standard ones.  For a production environment, you probably want to remove all of the Tomcat webapps other than manager.

 - 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org