You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul Taylor <pa...@fastmail.fm> on 2005/01/11 10:06:04 UTC

Multiple domain names to a single site

I have three domains

mycompany.com
mycompany.net
myapp.com

I have setup a website with a hosting provider using Tomcat 5 which 
contains the ROOT application and myapp application so currently
if user goes to http://mycompany.host/ they will go to ROOT application 
and if they go to http://mycompany.host/myapp it will go to myapp 
appliation.

I now want to change the dns records of my domains to point to my website.

My question is are all the domains equal or is there a concept of a 
master and aliases, i.e should I just change the nameservers  of all 
three domains to use my hosts name servers or is it more complicated to 
that for example I could map mycompany.net to redirect to mycompany.com.

Also is it possible for myapp.com to go straight to the relvent 
application (http://mycompany.host/myapp) rather than the root 
application (http://mycompany.host/)

Thanks Paul

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


Re: Multiple domain names to a single site

Posted by Paul Taylor <pa...@fastmail.fm>.
Still struggling perhaps I need to buy a book but Ive had a tentaive 
look at your options
Parsons Technical Services wrote:

> Does the dnsmanager have a choice for redirection of an URL?
>
It has lots of choices, you can change the dn server, and can use their 
own dnsmanager to chanage various web,domain and email settings. 
Unfortunately there is a lack of documentation explaining it. There is 
nothing saying redirection but I have raised a support request so wiill 
see what happens.

> If not:
>
> If the URL is pointed to an IP it will not change on its own. You 
> could set up an app under a host of myapp.net and do a redirect to 
> .com yourself.
>
I think Im just llacking the understanding. My server.xml file and the 
one I previously used in another company just use the default host of 
localhost and that seemed to work ok. I did create a new host called 
www.mycompany.com which meant tomcat expect to find a directory of the 
same name underneath conf/Catalina but i cant really understand the 
point of it.

> Or
>
> I think you can do the rewrite of the URL from a jsp welcome page of 
> myapp.

I think Im right in saying this will only work on the default page 
www.mycompany.net not if they go to straight to 
www.mycompany.net/page1.jsp ecetera.

>
> OR
>
> Try the alias. I don't know if the alias will change the URL or not. 
> (Or is this what you were doing?)
>
Tried adding alises of www.mycompany.net and www.mycompany.com to the 
existing host of localhost but made no difference.

>
>
> Doug
>


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


Re: Multiple domain names to a single site

Posted by Parsons Technical Services <pa...@earthlink.net>.
Does the dnsmanager have a choice for redirection of an URL?

If not:

If the URL is pointed to an IP it will not change on its own. You could set 
up an app under a host of myapp.net and do a redirect to .com yourself.

Or

I think you can do the rewrite of the URL from a jsp welcome page of myapp.

OR

Try the alias. I don't know if the alias will change the URL or not. (Or is 
this what you were doing?)



Doug

----- Original Message ----- 
From: "Paul Taylor" <pa...@fastmail.fm>
To: "Parsons Technical Services" <pa...@earthlink.net>
Sent: Wednesday, January 12, 2005 5:41 AM
Subject: Re: Multiple domain names to a single site


>I changed the dns entries of myapp.com
> I then using the dnsmanager for my myapp.net domain to point to the ip 
> address of myapp.com but I was disappointed to find that although it took 
> me to the website it was still displayed as myapp.net NOT changed to 
> myapp.com
>
> Parsons Technical Services wrote:
>
>> Sorry I wasn't clear on that.
>>
>> You have two choices.
>> Either do a redirect in the dns (My dns has a GUI that allows me to do 
>> this so I don't know the details).
>>
>> Or use the alias entry in the host element for mycompany.com.
>> http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html#Host%20Name%20Aliases
>>
>> Doug
>>
>>
>> ----- Original Message ----- From: "Paul Taylor" <pa...@fastmail.fm>
>> To: "Tomcat Users List" <to...@jakarta.apache.org>
>> Sent: Tuesday, January 11, 2005 11:21 AM
>> Subject: Re: Multiple domain names to a single site
>>
>>
>>> Parsons Technical Services wrote:
>>>
>>>> You will be working with the host entries in the server.xmlFrom how I 
>>>> read this you want mycompany..com and .net pointing at the same app. 
>>>> You can do this either at the dns level or in the host entry with an 
>>>> alias. As for master slave the master will be the desired URL. If you 
>>>> want people to use .com the set it up as your main entry and the 
>>>> redirect in the dns or alias .net to it. This way when they get to the 
>>>> site the URL in the address will be .com
>>>>
>>>> If the mycompany site is the default site, as it appears to be, any URL 
>>>> that points to the server IP that does not have a matching host entry 
>>>> will go to the mycompany site. So you could just point both mycompany 
>>>> urls to the IP and it will work. With this the URL will remain as typed 
>>>> .com or .net   For public relations don't do this as confusion will 
>>>> result. Especially when it comes to email.
>>>>
>>> You have understood me correctly and I understand what you say in 
>>> principal. I want to do achieve the first case you describe so that if 
>>> they enter www.mycompany.com it will remain so, if they enter 
>>> www.mycompany.net it will redirect as www.mycompany.com. But Im still 
>>> not sure how to do this, when you say mainentry do you mean using dns or 
>>> do you mean the first host in server.xml (currently I just have the 
>>> default localhost confgured).  Then how do I create an alias for the 
>>> second address is 'alias' a  tomcat thing or a dns thing ?
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>>
>>>
>>>
>>
>>
>>
>
>
> 



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


Re: Multiple domain names to a single site

Posted by Parsons Technical Services <pa...@earthlink.net>.
Sorry I wasn't clear on that.

You have two choices.
Either do a redirect in the dns (My dns has a GUI that allows me to do this 
so I don't know the details).

Or use the alias entry in the host element for mycompany.com.
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html#Host%20Name%20Aliases

Doug


----- Original Message ----- 
From: "Paul Taylor" <pa...@fastmail.fm>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, January 11, 2005 11:21 AM
Subject: Re: Multiple domain names to a single site


> Parsons Technical Services wrote:
>
>> You will be working with the host entries in the server.xmlFrom how I 
>> read this you want mycompany..com and .net pointing at the same app. You 
>> can do this either at the dns level or in the host entry with an alias. 
>> As for master slave the master will be the desired URL. If you want 
>> people to use .com the set it up as your main entry and the redirect in 
>> the dns or alias .net to it. This way when they get to the site the URL 
>> in the address will be .com
>>
>> If the mycompany site is the default site, as it appears to be, any URL 
>> that points to the server IP that does not have a matching host entry 
>> will go to the mycompany site. So you could just point both mycompany 
>> urls to the IP and it will work. With this the URL will remain as typed 
>> .com or .net   For public relations don't do this as confusion will 
>> result. Especially when it comes to email.
>>
> You have understood me correctly and I understand what you say in 
> principal. I want to do achieve the first case you describe so that if 
> they enter www.mycompany.com it will remain so, if they enter 
> www.mycompany.net it will redirect as www.mycompany.com. But Im still not 
> sure how to do this, when you say mainentry do you mean using dns or do 
> you mean the first host in server.xml (currently I just have the default 
> localhost confgured).  Then how do I create an alias for the second 
> address is 'alias' a  tomcat thing or a dns thing ?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



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


Re: Multiple domain names to a single site

Posted by Paul Taylor <pa...@fastmail.fm>.
Parsons Technical Services wrote:

> You will be working with the host entries in the server.xmlFrom how I 
> read this you want mycompany..com and .net pointing at the same app. 
> You can do this either at the dns level or in the host entry with an 
> alias. As for master slave the master will be the desired URL. If you 
> want people to use .com the set it up as your main entry and the 
> redirect in the dns or alias .net to it. This way when they get to the 
> site the URL in the address will be .com
>
> If the mycompany site is the default site, as it appears to be, any 
> URL that points to the server IP that does not have a matching host 
> entry will go to the mycompany site. So you could just point both 
> mycompany urls to the IP and it will work. With this the URL will 
> remain as typed .com or .net   For public relations don't do this as 
> confusion will result. Especially when it comes to email.
>
You have understood me correctly and I understand what you say in 
principal. I want to do achieve the first case you describe so that if 
they enter www.mycompany.com it will remain so, if they enter 
www.mycompany.net it will redirect as www.mycompany.com. But Im still 
not sure how to do this, when you say mainentry do you mean using dns or 
do you mean the first host in server.xml (currently I just have the 
default localhost confgured).  Then how do I create an alias for the 
second address is 'alias' a  tomcat thing or a dns thing ?



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


Re: Multiple domain names to a single site

Posted by Parsons Technical Services <pa...@earthlink.net>.
Since you asked so nicely.

You will be working with the host entries in the server.xml

>From how I read this you want mycompany..com and .net pointing at the same 
app. You can do this either at the dns level or in the host entry with an 
alias. As for master slave the master will be the desired URL. If you want 
people to use .com the set it up as your main entry and the redirect in the 
dns or alias .net to it. This way when they get to the site the URL in the 
address will be .com

If the mycompany site is the default site, as it appears to be, any URL that 
points to the server IP that does not have a matching host entry will go to 
the mycompany site. So you could just point both mycompany urls to the IP 
and it will work. With this the URL will remain as typed .com or .net   For 
public relations don't do this as confusion will result. Especially when it 
comes to email.

For the myapp.com add a new host entry under the existing Engine tag "like"

      <Host appBase="webapps" name="www.myapp.com" debug="99">
        <Logger className="org.apache.catalina.logger.FileLogger" 
prefix="myapp_log." suffix=".txt" timestamp="true"/>
      </Host>
Note logging will vary with version. Copy existing entry and modify.



In the myapp.xml for myapp.com, under the context tag change the path to be 
"".

My setup differs in that myapp.com for me uses a different appbase from 
webapps. So if something doesn't work hopefully someone can point out the 
error.

Doug



----- Original Message ----- 
From: "Paul Taylor" <pa...@fastmail.fm>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, January 11, 2005 10:17 AM
Subject: Re: Multiple domain names to a single site


> Could anyone get me started on this please ?
> Paul Taylor wrote:
>
>> I have three domains
>>
>> mycompany.com
>> mycompany.net
>> myapp.com
>>
>> I have setup a website with a hosting provider using Tomcat 5 which 
>> contains the ROOT application and myapp application so currently
>> if user goes to http://mycompany.host/ they will go to ROOT application 
>> and if they go to http://mycompany.host/myapp it will go to myapp 
>> appliation.
>>
>> I now want to change the dns records of my domains to point to my 
>> website.
>>
>> My question is are all the domains equal or is there a concept of a 
>> master and aliases, i.e should I just change the nameservers  of all 
>> three domains to use my hosts name servers or is it more complicated to 
>> that for example I could map mycompany.net to redirect to mycompany.com.
>>
>> Also is it possible for myapp.com to go straight to the relvent 
>> application (http://mycompany.host/myapp) rather than the root 
>> application (http://mycompany.host/)
>>
>> Thanks Paul
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



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


Re: Multiple domain names to a single site

Posted by Paul Taylor <pa...@fastmail.fm>.
Could anyone get me started on this please ?
Paul Taylor wrote:

> I have three domains
>
> mycompany.com
> mycompany.net
> myapp.com
>
> I have setup a website with a hosting provider using Tomcat 5 which 
> contains the ROOT application and myapp application so currently
> if user goes to http://mycompany.host/ they will go to ROOT 
> application and if they go to http://mycompany.host/myapp it will go 
> to myapp appliation.
>
> I now want to change the dns records of my domains to point to my 
> website.
>
> My question is are all the domains equal or is there a concept of a 
> master and aliases, i.e should I just change the nameservers  of all 
> three domains to use my hosts name servers or is it more complicated 
> to that for example I could map mycompany.net to redirect to 
> mycompany.com.
>
> Also is it possible for myapp.com to go straight to the relvent 
> application (http://mycompany.host/myapp) rather than the root 
> application (http://mycompany.host/)
>
> Thanks Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


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