 |
Linode Forum Linode Community Forums
|
| Author |
Message |
liquid_1520
Joined: 22 May 2010
Posts: 4
|
| Posted: Sat May 22, 2010 9:58 am Post subject: Virtual Hosts |
|
|
So, I'm usually used to making 1 site per VPS, but I need to host 2 on 1 VPS to save money. I have fedora 12 and apache on it. This is my vhost.conf file
Code:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin liquid.1520@al-rs.net
ServerName teamlnd.com
ServerAlias www.teamlnd.com
DocumentRoot /home/stryker/www/
ErrorLog /home/stryker/logs/error.log
CustomLog /home/stryker/logs/custom.log combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin liquid.1520@al-rs.net
ServerName rs-legacy.com
ServerAlias www.rs-legacy.com
DocumentRoot /home/legacy/www/
ErrorLog /home/legacy/logs/error.log
CustomLog /home/legacy/logs/custom.log combined
</VirtualHost>
I just want to make sure that it's right before I switch servers.
And, my domains are hosted on godaddy + 1and1. If I pointed the domains to those IPs, would it work fine right now? Or would I need to do something else? |
|
| Back to top |
|
rsk
Joined: 24 Nov 2009
Posts: 306
|
| Posted: Sat May 22, 2010 11:13 am Post subject: |
|
|
Seems perfectly good, just check twice if the user webserver's running at has read (and write, if necessary) access to the site dirs.
And yes, you just need to point the A records for "@" and "www" in your current domain control panel to the Linode's IP.
Also, if you want to do a "dry test" before switching the DNS, you can add a line
Code:
your.linodes.ip.addr teamlnd.com www.teamlnd.com rs-legacy.com www.rs-legacy.com
to your /etc/hosts or %SystemRoot%\system32\drivers\etc\hosts file, to make your own PC access the Linode when given one f these names. |
|
| Back to top |
|
liquid_1520
Joined: 22 May 2010
Posts: 4
|
| Posted: Sun May 23, 2010 10:16 am Post subject: |
|
|
Ok thanks, and should I remove that line once I point the domains, or no?
Also, I have the domains already pointed to the site, which is on another host. Is there anyway I can test it without having to re-point the domains? |
|
| Back to top |
|
rsk
Joined: 24 Nov 2009
Posts: 306
|
| Posted: Sun May 23, 2010 10:39 am Post subject: |
|
|
The hosts file "overrides" DNS resolution.
So, if you have a line in hosts file binding a domain name to some IP, it doesn't matter if the DNS isn't pointing to anywhere, or to somewhere else; your machine will use the IP specified.
So, it's a perfect way to test the "new" server while leaving the domain (and thus, everyone else in the world :)) to the "old" working address.
Once you're done, remove the line and repoint the DNS to new one, to switch the "whole Internet" to the new address. |
|
| Back to top |
|
| |
|