Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Nov 28, 2011 11:09 am 
Offline
Newbie

Joined: Mon Nov 28, 2011 10:59 am
Posts: 3
I would like to point another domain to my http://houghton.co site.
The second domain is http://neilhoughton.com.
I have tried editing my VirtualHosts but so far I am unable to make this work. :?

Any help would be much appreciated.

EDIT: I think I fixed this.
If someone could confirm that this looks correct I will mark the post SOLVED.

/etc/apache2/sites-available/neilhoughton.com

<VirtualHost 178.79.134.46:80>
ServerAdmin neilandjune@gmail.com
ServerName neilhoughton.com
ServerAlias www.neilhoughton.com
DocumentRoot /srv/www/houghton.co/public_html/
</VirtualHost>


Last edited by mrneilypops on Tue Nov 29, 2011 2:41 am, edited 2 times in total.

Top
   
 Post subject: Re: 2 domains -> 1 site
PostPosted: Mon Nov 28, 2011 3:19 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
do you have a different virtualhost for houghton.com? if so, just add both of these to serveralias in that one. no need to have a separate vhost


Top
   
 Post subject: Re: 2 domains -> 1 site
PostPosted: Mon Nov 28, 2011 4:40 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
mrneilypops wrote:
nano /etc

Huh?


Top
   
 Post subject:
PostPosted: Sun Dec 04, 2011 12:01 am 
Offline
Senior Newbie

Joined: Thu Sep 29, 2011 3:07 pm
Posts: 11
So, based on your edit, it looks like you have two virtualhost entries, one for houghton.co and one for neilhoughton.com?

If they're redirecting to the exact same set of documents on your server, you only need one virtualhost declaration that would look something like this:

Code:
<VirtualHost *:80>

ServerAdmin neilandjune@gmail.com
ServerName houghton.co
ServerAlias www.houghton.co neilhoughton.com www.neilhoughton.com

DocumentRoot /srv/www/houghton.co/public_html/

</VirtualHost>


I do this on one server of mine a lot, to park purchased domains to our company's home page until they are associated with their respective codebase.

Also, your VirtualHost line starts with the IP and port 80, as opposed to mine, which is *:80. Unless you have multiple IP addresses and need to explicitly make sure one site answers on one IP and another answers on another IP, either way works in your case.

I honestly don't know if there is a "best practices" way to do it, as I'm only a newbie to being a sysadmin. Everything I've learned is through Google, and Linode's documentation, so take my advice with a grain of salt, it may not be perfect :) All I know is that it works for me, and works well!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group