Web Geeks: Two separate domain names on one IP address/one box? How do you do it?

I have one box with one IP address. So if I type in www.mycompany.com I get my home page. Now I own another domain, and want to put it on the same box, which just has the one IP address. Is this feasible? If so, how does one do it, and are there any issues I should be concerned about?

Or can you point me to a resource?

thanks!

Try the boards over at dsl reports, this seems right up their alley.

This is called virtual hosting. First you’ll need to tell a name server about the names and IP address. Then you’ll need to tell your computer about its multiple names. Finally, you’ll have to configure the web server and set up independent directory spaces. You may also need to configure other things like FTP and email as well.

I can’t get any more detailed than this because you didn’t supply any details about your setup: OS version, web server and version, etc. Odds are you’re on a Windows machine anyway, in which case I can’t really help you.

in apache there is a setup which will point a host name to a particular directory

i.e.

<VirtualHost 192.168.1.110:8080>

ServerName www.my-domain.com
DocumentRoot /var/www/html/

</VirtualHost>

<VirtualHost 192.168.1.110:8080>

ServerName sillyserver.my-domain.com
DocumentRoot /var/www/html/sillyserver

</VirtualHost>

<VirtualHost 192.168.1.110:8080>

ServerName camaroz28.2y.net
DocumentRoot /home/user/

</VirtualHost>

The DNS point to the IP and the server resolves name and points to directory. Simple, in IIS this is done through a nifty spiffy GUI.

Terminus - thanks. We are on an IIS box. Our problem here is that we really don’t have anyone who’s a web server expert. Just one IT guy (not me) who handles PC repairs and the internal network. So it’s fallen to me to try and figure this out - the company we bought the box from doesn’t do support (or we don’t pay for it).

I guess what I really need is a pointer to a great resource/tutorial on how to set up IIS virtual hosts. Been looknig around, nothing great so far.

Boobka, thanks also.

I think it is easy, you just have to set the host header info for each particul site in IIS, and create seprate folders under the server. Sorry I don’t have IIS installed here I would have to look at home… maybe someone else can check.

If you aren’t Windows NT Server, I don’t think IIS has the capability for virtual hosting.

After extensive googling, I can’t find a cite for my above assertion, however, I did install IIS on an XP machine and it definitely did not have the capability for virtual hosts, even for multiple sites on a single domain, like site1.domain.com, site2.domain.com, etc…

If you really need the capability, and aren’t using Windows NT Server (or Advanced Server, or Datacenter Server), I recommend installing apache.

FoxServ makes the windows setup of apache pretty painless, and includes many other useful modules like php and mySQL.

If you ARE using a server version of windows, then feel free to disregard my posts, though there are still other benefits to using apache instead of IIS, IMHO.

Personal Web Server (which is what Microsoft calls IIS when it runs on XP or on 2K Professional) does NOT support virtual hosts. IIS only supports virtual hosts when run on NT Server, 2000 Server, or .NET Server.

If you are using a Server installation, you must create additional sites (not folders) in the IIS configuration container for each virtual host and set each site’s hostname in the “advanced” properties (IIRC; it’s been a while).

Don’t forget to make sure your patches are current, as there are some really nasty bugs in IIS that will get your machine rooted if you don’t close them.

Ok, I think I got the host header bit, IIS does look like it provides a pretty easy interface to take care of it. Though I haven’t used it yet.

next question (maybe it’s a stupid one): how do you configure the actual folders on the server so the IIS knows which file to grab depending upon the website? I mean, currently I have a root folder at my IP, and there is a default page assigned to that (let’s say it’s www.myhouse.com). Now I’ve added www.mycondo.com as a host header, but how do I tell IIS which default file/folders are assigned to www.mycondo.com?

Does that make any sense?

thanks

Did we decide if you have NT Server or just regular NT Workstation?

If you have NT Server then add a virtual host for www.mycondo.com just like you added www.myhouse.com and make it point to the right place.

If you are NOT using NT Server, here’s a trick we use with one of our sites.

That is what our default.asp page looks like for www.mysite.com. All of the sites on the MySite Network are hosted in the same folder, under the same IP and have Host Headers.

This code says “depending on what URL the person used to get here, redirect them to this folder”

Make sense?

Create two sites (right click on the web server’s host name and select “New Web Site”). One has the www.myhouse.com host header, and its “home directory” set to wherever the files for that site are. The other has the www.mycondo.com host header and its “home directory” set to wherever the files for that site are. Do not put both host names on the same site, that will not do what you want. Both sites should be assigned to “all unassigned” (unless you’re also doing IP-based hosting, in which case you need a consultant).

There’s no need for the ASP scripting trick ZipperJJ offers unless you want to actually share files between the sites (and even then you can do that by setting up virtual directories underneath the site and point them to the same physical location). It’s a just hack to get around the shortcomings in PWS.

Please also note that you’re reaching the limit of what, at least, I’ll answer without the payment of a consulting fee. If you’re still not clear on what to do now, I strongly suggest hiring a consultant.

KellyM and everyone - thanks for assistance, understand where you’re coming from since I’ve done the consultant thing before. I’m gonna give all this a go on the box tomorrrow and see what happens. If things start to spark and the lights go out in the office, maybe I can convince the higher-ups to get someone with real knowledge in here. :slight_smile: