I am a web developer and I would like to setup IIS to do this:
1. My physical structure:
Each folder is a website for that company
2. On my local system, I would like to access to a company's website as:
Before using IIS, I was using Apache and we can setup httpd.conf as:
and define domain company1, company2 in
How do I setup this feature in IIS. Thanks very much for your help.
In general, one can set up similar web server configuration on IIS and Apache, given comparable customization module(s) and configuration. In this case, the desired configuration can be performed in a couple of ways using the scriptable administration interface of IIS.
With IIS6, there is a commandline tool, iisweb.vbs, which uses the scriptable administration interface and illustrates how to perform and automate the task:
iisweb.vbs /create D:\www\company1 Company1 /d:company1
The same configuration can be set more manually on prior IIS versions with a more generic tool, adsutil.vbs, located in %systemdrive%\inetpub\adminscripts. The following command sequence works on all IIS versions and is equivalent to what iisweb.vbs performs:
adsutil.vbs CREATE W3SVC/1000 IIsWebServer
adsutil.vbs SET W3SVC/1000/ServerBindings "127.0.0.1:80:company1"
adsutil.vbs CREATE W3SVC/1000/ROOT IIsWebVirtualDir
adsutil.vbs SET W3SVC/1000/ROOT/Path "D:\www\company1"
Note it is important to use a unique ID # for each website (i.e. I chose 1000) and the proper KeyType (case sensitive) for each configuration node needs to be provided on the CREATE - and iisweb.vbs takes care of that amongst other features and details.
You can use this script to check your website configuration.