1

I'm having trouble finding info on this one, even having access to my company domain controller I still can't see what configuration is causing the same behavior I want to mimic on my home server.

I'm working from a test environment on my home PC and would like the following behavior. Note that I do not require any of these sites be accessible anywhere but my local machine, again, I just want to learn.

My Goal:

To configure IIS to host multiple sites, accessible via "aliases" which map to different ports. For example:

  • home -> localhost:81
  • test -> localhost:82
  • dev -> localhost:83

Furthermore, I want the url in my address bar to actually BE what it says on the left, not simply redirect, BLEH! So if I type "home/" in my address bar, it should load the page at "http://home/".

How can I achieve this? Thanks... ;)

Here's what I have configured in my bindings for the site so far, but no cigar...

enter image description here

Chiramisu
  • 4,687
  • 7
  • 47
  • 77

2 Answers2

2

first you need to edit your hosts file (probably C:\WINDOWS\System32\drivers\etc) so that you resolve home for example to localhost, add records like this:

127.0.0.1 home
127.0.0.1 test

...

Then you should be able to set up your IIS site with the Host name as home, but leave the port to the default of 80.

Sam Peacey
  • 5,964
  • 1
  • 25
  • 27
  • I run my IIS sites on 82 because I have my Glassfish sites on 80. Is there a way the port can be inferred by the url I enter in the address bar? Is this not supported by browsers or what's the issue? Is the port always necessary when not port 80? – Chiramisu Jun 10 '12 at 05:24
  • Yeah things get more complicated if you want to map the ip and port (if you don't supply a port to the browser, 80 is always assumed for http). You'll need some other software - either a browser plugin, or if you use fiddler, it looks like this: http://haacked.com/archive/2007/01/10/HTTP_Debugging_Using_Reverse_Proxies_And_Port_Forwarders.aspx might work. – Sam Peacey Jun 10 '12 at 05:37
  • Grrrrr, how annoying. I know it seems like a really silly thing, but when I constantly have to keep appending the ports for my test servers gets annoying when I'm switching between programming platforms. Well thanks anyway. ;) – Chiramisu Jun 10 '12 at 05:53
  • No problem. :) Is your Glassfish site apache? If so routing your IIS sites through apache might be an option? See here for more info: http://stackoverflow.com/questions/108387/apache-and-iis-side-by-side-both-listening-to-port-80-on-windows2003 – Sam Peacey Jun 10 '12 at 06:00
  • O.o very clever, didn't even think of that. It looks like there are some options for doing it from IIS... still learning Glassfish though. It's an excruciatingly different paradigm and interface, so it's like re-learning web server management from scratch. To be honest, I still prefer IIS. :P – Chiramisu Jun 10 '12 at 06:30
  • I'd never even heard of Glassfish until you mentioned it, but I don't get too close to Java in my travels. Anyway, glad you've got something to work from now. :) – Sam Peacey Jun 10 '12 at 06:56
1

When I create a site in IIS I select for IP "All Unassigned" and then make a unique port.

I access my sites via the outside world like this:

http://mbdev.myftp.biz:8004

http://mbdev.myftp.biz:8006

Those all go to demos sites.

MBDEV
  • 31
  • 3