본문 바로가기

프로그래밍/미분류

[IIS] 윈도우즈 XP 프로페셔널에서 여러 웹사이트

반응형
윈도우즈 XP 프로페셔널에서 여러 웹사이트
Multiple websites on Windows XP Professional
(Kristofer Gafvert, March 6, 2005)

윈도우즈 XP 프로페셔널은 다수의 웹사이트를 지원하지 않는다. 윈도우즈 XP IIS 관리자로는 서버에디션에서처럼 새로운 웹사이트를 생성할 수 없다. 그러나 코드를 이용해서 XP에서 새 웹사이트를 만들 수 있으며, 이 제한은 GUI에 국한된 것이다. ADSI, WMI 를 이용하면 이 짓을 할 수 있다. 하지만, 동시에 XP에서 여러 웹사이트를 돌리는 것은 허용되지 않으며, 이미 다른 웹사이트가 운용중일 때, 두번째 웹사이트를 IIS 관리자로 시작하려고 하면, 다음과 같은 에러가 난다.

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

동시에 여러 웹사이트를 돌리려면, 윈도우즈 서버 2003 같은 서버버전을 알아봐야 한다.
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.

(이 글을 쓸 때) 가장 좋은 방법은 IIS Admin 을 사용하는 것이다. IIS Admin은 써드파티 개발자가 이 목적으로 개발한 것이다. 쉽게 웹사이트를 생성, 삭제, 시작, 종료할 수 있다. 다른 방법은 C:\Inetpub\AdminScripts (Windows XP, 디폴트 설치폴더)에 있는 adsutil.vbs 를 이용하는 것이다. (명령행 프롬프트에서) 다음 명령을 실행한다.:
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

(2)라는 번호는 새로운 웹사이트의 웹사이트 ID이다. 여러 개의 웹사이트를 생성하려면, 매번 유일한 ID가 필요다. 첫번째 명령은 새로운 웹사이트를 만들 것이다. 두번째 명령은 필요한 데이터를 새로만든 웹사이트로 복사한다.
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.

세번째 방법은 IIS 6.0 리스소 키트 도구의 Metabase Explorer 를 사용하는 것이다. (윈도우즈 XP에도 이 툴을 설치할 수 있다.) 디폴트 웹사이트를 복사하고, 붙여넣기하면, 새로운 웹사이트가 생긴다.
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.

네번째 방법은 WMI/ADSI 를 사용해서 코드로 웹사이트를 생성하는 것이다. MSDN의 IIS SDK에 어떻게 사용하는지가 나와있다.
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.

윈도우즈 XP에 새 웹사이트를 만든 후에 IIS 관리자에선 빨간색 에러 아이콘이 웹사이트 앞에 붙어 있는 걸 보게 된 것이다. 이는 IIS가 웹사이트를 실행하려했으나, 제한 때문에 실행하지 못했기 때문이다.
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).

웹사이트를 삭제하려할 때에도, IIS관리자에서는 웹사이트를 지울 수 없다는 걸 알게 될 것이다. GUI가 웹사이트 생성을 지원하지 않는데, 삭제를 지원할 리는 없을 것이다. 그러나 다행히도, adsutil.vbs, Metabase Explorer, ADSI/WMI 로 웹사이트를 지울 수 있다. adsutil.vbs 로 웹사이트를 지우고자 할 때에는 명령행에서 다음과 같이 입력하라:
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

윈도우즈 XP의 IIS는 ISAPI 필터를 지원하고, 이를 이용하면 웹사이트를 여러 개 만들 수 있다. 즉, 실제론 여러 개의 웹사이트는 아니지만, 여러 개인 것처럼 동작할 것이다. MultiSite Filter 버전 2는 이런 기능을 제공하는 무료 ISAPI 필터이다.
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.

출처 : http://www.gafvert.info/iis/article/multiple_websites_xp.htm

728x90