Multiple websites on Windows XP Professional

Started by saos@ngmo, 29/10/08, 11:24

Previous topic - Next topic

saos@ngmo

Tip để tạo nhiều website trên windows XP

Windows XP Professional does not support multiple websites. You cannot create new websites using IIS Manager for Windows XP, as you can on a server edition. It is however possible to create a new website on Windows XP by code, so the limition is in the GUI. This can be done using ADSI or WMI. IIS on Windows XP does however not allow you to run multiple websites simultaneously, and if you try to start a second website using IIS Manager, when there is already one running, you will get this error message:

The request is not supported

If you truly need to run multiple websites simultaneously, you should look into using a server edition such as Windows Server 2003.

For a developer, it is a bit troublesome to work on multiple websites, when the development machine does not support multiple websites. There is however several ways around this.

The most elegant (when writing this) is to use IIS Admin, developed by a third-party developer for this purpose. It is simple to use, to create, delete, start and stop websites. A second option is to use adsutil.vbs, located in the folder C:\Inetpub\AdminScripts (Windows XP, default installation). The command to use is (from a command prompt):

C:\Inetpub\AdminScripts> cscript.exe adsutil.vbs create_vserv W3SVC/2
C:\Inetpub\AdminScripts> cscript.exe adsutil.vbs copy W3SVC/1 W3SVC/2

The number (2) is the website ID of the new website. If you create multiple websites, you will need to use a unique ID each time. The first of these commands will create a new website. The second will copy all the necessary data from the default website, to your new website.

A third option is to use Metabase Explorer from the IIS 6.0 Resource Kit Tools (yes, you can install the tool on Windows XP). Copy the default website (/LM/W3SVC/1/) and then paste it. This will also give you another website, ready to use.

The fourth option is to use WMI/ADSI and create the website by code. Use the IIS SDK available at MSDN to get more help for this.

After you have created a new website on Windows XP (depending on how you did), you will notice that you have a red error icon in front of the website in IIS Manager. This is because IIS tried to start the website, but was not able to do so (because of the limitation).

When you are ready to delete the website, you will notice another problem...you cannot delete the website! (from IIS Manager). Since the GUI does not allow you create websites, why would it allow you to delete websites? Luckily enough, we can delete the website using adsutil.vbs, Metabase Explorer or ADSI/WMI. To delete a website using adsutil.vbs, write this in a command prompt:

C:\Inetpub\AdminScripts> cscript.exe adsutil.vbs delete W3SVC/2
Multiple websites at the same time

IIS on Windows XP supports ISAPI filters, and with the help of one, you can create multiple websites. Or, it is not really multiple websites, but it will act as if it were. MultiSite Filter Version 2 is a free ISAPI filter which gives you this functionality.


nguồn: http://www.gafvert.info/iis/article/multiple_websites_xp.htm

SEO ngành nghề, cỏ nhân tạo, chuyên sửa máy rửa bát tại hà nội, chuyên sửa chữa tivi tại nhà ở Hà Nội, đặt hàng tượng phật đồ thờ tâm linh làng nghề Sơn Đồng | Điện lạnh Bách Khoa Hà Nội