Multiple "localhost"s? - Posted (1650 Views)
Support Moderator
Shaggy
Posts: 6780
6780
I'm trying to figure out how to set up additional local "domains" (don't know the proper name) on IIS5 and can't find anything in the help files.
I'm currently working on 4 different sites that each need to run from the root directory and it's becoming a right pain the in the proverbial having to go in to IIS and change the home directory of the default website every time I want to proof something.
Anyone know how I would go about setting it up so I could just have http://sitename/ point to a local directory for each site?
On a related note, because my websites need to run from the root directory, before uploading the proofs to a subdirectory on our server for our clients every evening, I have to go through each file for the site and change all the includes, links, CSS, etc. from pointing to the root directory to pointing to the subdirectory on our server. Any suggestions for working around this so I wouldn't have to make any changes? As you can imagine, it's quite a tedious & time consuming process, even more so when you're working on 4 sites simultaneously.
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Average Member
SiSL
Posts: 671
671
Simple, go to C:\Windows\system32\drivers\etc folder and edit "hosts" file...
Such as adding lines:
127.0.0.1 myfakedomain.com
127.0.0.1 fakedomain.com

Then from IIS options, just add "host headers" of myfakedomain.com or fakedomain.com and you'll be able to see them as http://myfakedomain.com from local...
<
Posted
Forum Admin
HuwR
Posts: 20611
20611
or just assign a different portnumber for each website and then
use
http://localhost:8080
http://localhost:8081

etc.<
Posted
Development Team Leader
Classicmotorcycling
Posts: 2085
2085
Or you can use "host headers" which has been around from IIS4 and is quite easy to use. It allows you to use the 1 local host IP (or any other IP Address) with multiple sites and the host file is the easiest way to point the extra sites to your host header like so:

127.0.0.1 myfakedomain.com fakedomain.com anotherfakedomain.com morefakedomain.com

I can do a quick doc to show you how to use host headers if you want. <
Cheers,

David Greening
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Thanks for the suggestions, guys. Think the host headers might be the way to go for me, saves me trying to remember which port is for which site.
I already know how to edit the hosts file as SiSL posted above (our ISP in work is obscenely slow at updating their DNS) so I' just need to know how to set the home directory for each of my new fake domains. Note that in IIS, all I have available is the default web site and the context menu for the "Web sites" node doesn't have the option to create a new site (IIS 5.1 running on XP SP3).
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Forum Admin
HuwR
Posts: 20611
20611
ah, you should have mentioned you had XP smile
you are buggered since you can't create more than one website<
Posted
Average Member
SiSL
Posts: 671
671
yeah, you are stucked with one site in XP :)

Alright, here is your solution:

http://www.helicontech.com/isapi_rewrite/

Basic idea is to forward incoming different type of hosts to different folders in your site... <
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Originally posted by HuwR ah, you should have mentioned you had XP smile
you are buggered since you can't create more than one website
Ah, knackers! sad Bit of a silly restriction, that.
SiSL, can't see the boss throwing a hundred bucks at some software to solve what is, essentially, just a minor inconvenience. Would the light (spell it properly, ****it!) version do the job for me, maybe?
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Forum Admin
HuwR
Posts: 20611
20611
check this out Shaggy

http://www.codeproject.com/KB/cs/iisadminnet.aspx<
Posted
Support Moderator
Shaggy
Posts: 6780
6780
Thanks, Huw; looks like that's exactly what I need smile Can't get on to my server at the moment to create and e-mail address to register with so I'll have to wait 'til Monday to try it out.
<
Search is your friend “I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Posted
Forum Admin
HuwR
Posts: 20611
20611
you can download it from here http://www.codeplex.com/iisadmin as well<
You Must enter a message