 |
Linode Forum Linode Community Forums
|
| Author |
Message |
mrneilypops
Joined: 28 Nov 2011
Posts: 1
|
| Posted: Mon Nov 28, 2011 10:09 am Post subject: [Solved] 2 domains -> 1 site |
|
|
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> |
|
| Back to top |
|
glg
Joined: 09 Jan 2009
Posts: 505
|
| Posted: Mon Nov 28, 2011 2:19 pm Post subject: Re: 2 domains -> 1 site |
|
|
| 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 |
|
| Back to top |
|
hybinet
Joined: 02 May 2008
Posts: 1058
|
| Posted: Mon Nov 28, 2011 3:40 pm Post subject: Re: 2 domains -> 1 site |
|
|
mrneilypops wrote: nano /etc
Huh? |
|
| Back to top |
|
bandgeekndb
Joined: 29 Sep 2011
Posts: 8
|
| Posted: Sat Dec 03, 2011 11:01 pm Post subject: |
|
|
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! |
|
| Back to top |
|
| |
|