Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Enthusiast Zone > Networking > Clear instructions for creating a virtual-host name?

Clear instructions for creating a virtual-host name?
Thread Tools
olePigeon
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Dec 6, 2011, 01:29 PM
 
I have three websites and only 1 server with 1 static IP. I'd like to have all three websites hosted on the server.

I was looking into it, and apparently I can set up some virtual-host names for different websites so they can use the same IP address. I've never done this before. Does anyone have clear instructions or a tutorial on how to set up a Snow Leopard Server so I can host 3 different websites with the same IP?

Thanks.
"…I contend that we are both atheists. I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible gods,
you will understand why I dismiss yours." - Stephen F. Roberts
     
ibook_steve
Moderator
Join Date: Oct 2001
Location: San Jose, CA
Status: Offline
Reply With Quote
Dec 6, 2011, 03:01 PM
 
I used to do this for a living when I worked for an ISP way back when, but I had completely forgotten.

You need to use CNAMEs to make the aliases once you've assigned a main name to the IP address.

This page looks like a good little tutorial:

Set Up a DNS Name Server | Webmonkey�| Wired.com

Steve
Celebrating 10 years and 4000 posts on MacNN!
     
olePigeon  (op)
Clinically Insane
Join Date: Dec 1999
Status: Offline
Reply With Quote
Dec 6, 2011, 03:22 PM
 
I don't think that's quite what I'm looking for. I'm aware of CNAMEs, but isn't that for aliases for the same domain? Like www.whatever.com or mail.whatever.com.

I wanted to set up 3 completely different websites, i.e. www.whatever.com www.something.com and www.meaningless.com
( Last edited by olePigeon; Dec 6, 2011 at 03:45 PM. )
"…I contend that we are both atheists. I just believe in one fewer god than
you do. When you understand why you dismiss all the other possible gods,
you will understand why I dismiss yours." - Stephen F. Roberts
     
ibook_steve
Moderator
Join Date: Oct 2001
Location: San Jose, CA
Status: Offline
Reply With Quote
Dec 6, 2011, 06:32 PM
 
Oh, you're saying you want all three domain names to point to the same IP address? I'm pretty sure all you need is 3 assignments all to the same IP address. You don't need to do anything special.

www.whatever.com. A 192.168.0.1
www.something.com. A 192.168.0.1
www.meaningless.com. A 192.168.0.1

Steve
Celebrating 10 years and 4000 posts on MacNN!
     
Waragainstsleep
Posting Junkie
Join Date: Mar 2004
Location: UK
Status: Offline
Reply With Quote
Dec 6, 2011, 08:39 PM
 
People have different ideas about whether to use multiple A records or CNAMEs. Both can work and for web its less of a problem. Can be an issue with mail servers as reverse lookups are getting more important.

Anyway, I'm guessing what you want is to be able to differentiate the different sites on the one server. Like when a client connects to your web server via its IP, how does the server know which site to send it to right?

You can do it all from Server Admin by filling out the general tab under the web settings. Its actually pretty obvious once you start. Just click the add button under the list at the top to add a new site. Fill out host name, pick a local IP address, port, web folder, index page, error page and an admin email. Repeat this process for your other sites. Then (assuming you are using DNS on your server too) set up the CNAMEs or A records to point all your sites to your server's local IP.

Point a client to your server for DNS, then try each domain and it should give the right site for the right address. If you are running this from a DSL connection or similar, then you just have your router route all traffic on port 80 or whichever ports you want to use to the SL server and then you'll need to setup the proper records with your domain registrar(s) to either point public DNS requests or just to point each of your site addresses to your external IP.
I have plenty of more important things to do, if only I could bring myself to do them....
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:21 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,