[Solved] 2 domains -> 1 site
http://houghton.co
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
ServerName neilhoughton.com
ServerAlias
DocumentRoot /srv/www/houghton.co/public_html/
3 Replies
@mrneilypops:
nano /etc
Huh?
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:
<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