Tuesday, December 26, 2006

QA - Setting up IIS Virtual Host

Question:

I am a web developer and I would like to setup IIS to do this:
1. My physical structure:
d:/www/company1
d:/www/company2
...
d:/www/companyN
Each folder is a website for that company
2. On my local system, I would like to access to a company's website as:
http://company1/index.php
http://company2/index.php

Before using IIS, I was using Apache and we can setup httpd.conf as:

DocumentRoot "d:/www/company1"
ServerName company1


DocumentRoot "d:/www/company2"
ServerName company2


and define domain company1, company2 in
c:/windows/system32/drivers/etc/hosts as:
127.0.0.1 company1
127.0.0.1 company2

How do I setup this feature in IIS. Thanks very much for your help.

Answer:

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.

//David

13 comments:

filips said...

There is a step by step guide giving the details on Accessing Local IIS Web Sites via Name using the Hosts File

Cheers,
Blogging Developer
http://www.bloggingdeveloper.com

uiyui said...

Today is the gold für wow second day of 2009 ,world of warcraft gold it also a mesos special for me .cheap wow gold Because i have cheap maplestory mesos a chance to go to an english speech of LiYang and crazy to learn english follow him . He is a firendly,kindly person who make me feel good.wow gold kaufen What‘s more ,maple story mesos he very confidence .And he make me sure what he can do i also can do,as long as i make a determination and force myself to do it every second,Crazy just like him .wow geld I learn one setence from his book ever :maple story items If you want to succeed always force yourself to do more .I can't agree more with him .wow gold farmen To be honest ,when i was a littel girl i already fall in love with english.But what a pity i am poor in english ,Maple Story Account and it make me feel frustrating .So i want to give up many times ,but i can't as i still love it .So i tell mysefl :if you think you can you can wow leveling,and all your maple story power leveling hard work will pay off.wow power leveling Today i am very happy i can listien this wonderful speech of LiYang. I reap a great benifits from him .maple story money As he say :i am the best ,and every one can do it . world of warcraft power leveling Yes,i belive i can do it if i crazy as he buy archlord gold.Now i want to say :i will never give up.

Anonymous said...

At one time or another, I do not have the Atlantica online Gold ; at the first time, I am not willing to buy Atlantica Gold . But I do not wonder I buy the Atlantica online money , my friend thinks that I am ill. But when I have it, it carries the magic from such a group, such a link in the world, cheap Atlantica online Gold , it is the key bring you to this world. But buy Atlantica online Gold is the best desire that I make.

Without thinking I buy some dofus kamas . I use some kamas and want to find a good group. We often buy cheap kamas together on Monday. As if it is a rule. I think it is the real friendship. buy dofus kamas is already become the essential thing in my life. So I will introduce my friends have the dofus gold , we can be consist of a group, it must be very interesting.

Anonymous said...

What do you know World of Kung fu Gold. And do you want to know? You can get WoKf gold here. And welcome to our website, here you can play games, and you will buy World of Kung fu Gold to play game. I know cheap World of Kung fu Gold, and it is very interesting. Do you want a try, come and view our website, and you will learn much about World of Kung fu money. Come and join with us. We are waiting for your coming.

Do you know that the wow gold? The players often forget to eat meal when they play the online games. In the game many players need the World of Warcraft Gold to up their levels. so they often search where can warcraft gold, I think our website maybe is your best choice. Many friends told me that in here can get buy wow gold, and here you can also relax yourself. so i hope more and more players come here to buy the cheap wow gold.

Anonymous said...

Do you know latale online gold? I like it.
My brother often go to the internet bar to buy latale gold and play it.
After school, He likes playing games using these latale money with his friends.
I do not like to play it. Because I think that it not only costs much money but also spend much time. One day, he give me many buy latale online gold and play the game with me.
I came to the bar following him and found cheap latale gold was so cheap. After that, I also go to play game with him.
Do you know seal cegel? I like it.
My brother often go to the internet bar to buy sealonline cegel and play it.
After school, He likes playing games using these seal online cegel with his friends.
I do not like to play it. Because I think that it not only costs much money but also spend much time. One day, he give me many cheap seal cegeland play the game with me.
I came to the bar following him and found buy seal online cegelwas so cheap. After that, I also go to play game with him.

Anonymous said...

Do you know eve isk? I like it.
My brother often go to the internet bar to buy eve online isk and play it.
After school, He likes playing games using these buy isk with his friend.
I do not like to play it. Because I think that it not only costs much money but also spend much time. One day, he give me many cheap eve isk and play the game with me.
I came to the bar following him and found buy eve online isk was so cheap. After that, I also go to play game with him.
Do you know 2moons dil? I like it.
My brother often go to the internet bar to buy 2moons gold and play it.
After school, He likes playing games using these 2moon dil with his friend.
I do not like to play it. Because I think that it not only costs much money but also spend much time. One day, he give me many buy 2moons dil and play the game with me.
I came to the bar following him and found cheap 2moons gold was so cheap. After that, I also go to play game with him.

Anonymous said...

Have you heared about a game which you need use Atlantica online Gold to play, and you can also borrow Atlantica Gold from other players? But you can buy Atlantica online Gold, or you will lose the choice if you do not have cheap Atlantica online Gold. If you get Atlantica online money, you can continue this game.
Have you heared about a game which you need use Entropiauniverse ped to play, and you can also borrow Entropia Universe Gold from other players? But you can Buy Entropia Universe Gold, or you will lose the choice if you do not have Entropia Universe Money. If you get cheap Entropiauniverse ped, you can continue this game.

feilin said...

My friends like to play it and buy EtherSaga Online Gold. If you have money to buy EtherSaga Gold, you will find it is very useful. Earning EtherSaga Online money is not so hard. Try your best and then you can get it. I buy EtherSaga Gold, just because I like it. You will like to buy cheap EtherSaga Gold, believe me.
I am so happy to get some gw gold from my friends. They know I need GuildWars Gold, they give me. So I always can get some Guild Wars Gold from my friends. I buy GuildWars money with my spare money. It makes me happy that I can still earn some cheap gw gold.

Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.
Oes Tsetnoc | Semangat Mengembalikan Jati Diri Bangsa

gurgaonindustry said...

Schools In Gurgaon | Hotels In Gurgaon | Hospitals in Gurgaon | Jewelers In Gurgaon


i like your blog

Anonymous said...

The online Gossip Master of College ACB-watchestoo.com
http://www.watchestoo.com
replica watches
Men’s watches
Fake watches
watches
IWC
IWC Portuguese AUTOMATIC 5001 IW500101
IWC Portuguese AUTOMATIC 5001 IW500107
IWC Portuguese Automatic 7days IW500106
IWC Portuguese Automatic 7Days IW500109
IWC Portuguese Automatic 7days IW500114
IWC Portuguese Automatic 7days Limited Edition

Laureus IW500112

IWC Portuguese CHRONO AUTOMATI IW371438
IWC Portuguese CHRONO AUTOMATIC IW371401
IWC Portuguese CHRONO AUTOMATIC IW371404
IWC Portuguese CHRONO AUTOMATIC IW371417

Anonymous said...

Why the replica louis vuitton handbags are so popularity? Because of lv handbag original from France and are created by the top designer louis vuitton bag , the meaning of the label “LV” .

longge said...

A Panasonic NEWHART recorder can be a good item for one's home thanks to all of the features NEWHART DVD has. These recorders can work with many devices and several different NEWHART DVD COLLECTION formats. In addition to this there are a number of models from Panasonic for one to compare.

Contrary to the belief that high quality comes at a high price, ED Hardy are surprisingly affordable. Even if ED Hardy Shoes have become popular enough, they still managed to keep their prices reasonable. Choosing to buy hardy shirt is very practical. And not only this, but hardy shirts unique designs will also help you reveal your personality. You can never find such affordable quality anywhere else.

You will find that today the rage is very popular in skate shoes are now going out of style, and Hogan skate shoes are adjusting easily to this. Because Hogan scarpe uomo already has some Hogan skate shoes that are in the punk-rock style that many skateboarders today are looking for. Hogan scarpe donna transition to their new Hogan uomo skate shoe look is occurring so easily today because in the late 1990s when the fashion trend started they were able to experiment by re-issuing some of the earlier skate shoe models that they had.