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

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?

3 Replies

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

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.

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?

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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct