Visual Studio에서 웹 배포 문제 해결

적용 대상: 인터넷 정보 서비스

이 문서는 Visual Studio에서 웹 배포를 통해 올바르게 구성되지 않은 서버로 게시하려고 할 때 발생하는 일련의 오류를 해결하는 데 도움이 됩니다. 이 문서는 특정 제품 버전에 대해 작성되었지만 개념을 최신 버전에도 적용할 수 있습니다.

다음 스크린샷 및 오류를 수집하려면 Visual Studio 2010 SP1에서 새 ASP.Net MVC 3 프로젝트를 사용합니다. 대상 서버는 IIS(인터넷 정보 서비스)를 사용하는 Windows Server 2008 R2 SP1의 클린 설치였습니다. 다른 구성은 수행되지 않았습니다.

서버에 연결할 수 없음

발생할 가능성이 높은 첫 번째 오류는 Visual Studio의 출력 창에 있는 다음 스크린샷과 같습니다. 가독성을 향상하기 위해 메시지의 전체 텍스트가 스크린샷 아래에 제공됩니다.

Visual Studio의 오류 목록 출력을 보여 주는 스크린샷

Web deployment task failed.(Could not connect to the destination computer ("deployserver").On the destination computer, make sure that Web Deploy is installed and that the required process("The Web Management Service") is started.)
This error indicates that you cannot connect to the server. Make sure the service URL is correct,firewall and network settings on this computer and on the server computer are configured properly,and the appropriate services have been started on the server.
Error details:
Could not connect to the destination computer ("deployserver"). On the destination computer,
make sure that Web Deploy is installed and that the required process
("The Web Management Service") is started.
Unable to connect to the remote server
A connection attempt failed because the connected party did not properly respond after a period
of time, or established connection failed because connected host has failed to respond 1.1.1.1:8172

이 오류에서 강조 표시된 텍스트(및 아래의 다른 오류)는 문제의 특성을 이해하는 열쇠입니다. Web Deploy가 서버에서 회신을 받지 못했기 때문에 Visual Studio는 몇 가지 가능한 원인을 구분할 수 없습니다. 결과적으로, 그것은 시도 하는 것 들의 목록을 제공 합니다.

웹 관리 서비스가 설치되어 있나요?

IIS 서버에서 IIS(인터넷 정보 서비스) 관리자를 열고 컴퓨터 이름 노드를 선택합니다. 기능 보기에서 관리 섹션까지 아래로 스크롤하여 다음 아이콘을 찾습니다.

IIS 관리자 권한 아이콘, IIS 관리자 사용자 아이콘 및 관리 서비스 아이콘을 보여 주는 스크린샷

없는 경우 역할 서비스 추가 대화 상자를 통해 관리 서비스를 설치해야 합니다. 제품 탭에서 웹 플랫폼 설치 관리자를 통해 설치할 수도 있습니다 . 왼쪽 열에서 서버를 선택하고 IIS: 관리 서비스를 선택합니다.

참고

관리 서비스를 설치한 후에는 자동으로 시작되지 않으므로 시작해야 합니다. 이렇게 하려면 관리 서비스 아이콘을 두 번 클릭합니다. 관리 서비스 창이 표시되면 오른쪽의 작업 창에서 시작을 선택합니다.

서비스 URL이 올바른가요?

기본적으로 웹 관리 서비스는 포트 8172에서 수신 대기하지만 변경할 수 있습니다. 사용 중인 포트를 검사 가장 쉬운 방법은 위에서 설명한 대로 관리 서비스 창을 열고 Connections 섹션에서 IP 및 포트 정보를 살펴보는 것입니다. 포트가 8172 이외의 포트로 변경된 경우 새 포트가 방화벽을 통해 허용되는지 확인하고 Visual Studio 게시 설정에서 서비스 URL을 업데이트하여 새 포트를 사용해야 합니다.

(403) 금지됨

웹 관리 서비스가 설치되면 Visual Studio에서 다음 오류가 표시될 수 있습니다.

Visual Studio의 오류 목록 화면을 보여 주는 스크린샷

Web deployment task failed.(Could not connect to the destination computer ("deployserver") using
the specified process ("The Web Management Service") because the server did not respond.
Make sure that the process ("The Web Management Service") is started on the destination computer.)
Could not connect to the destination computer ("deployserver") using the specified process
("The Web Management Service") because the server did not respond. Make sure that the process
("The Web Management Service") is started on the destination computer.
The remote server returned an error: (403) Forbidden.

이 메시지는 다소 오해의 소지가 있습니다. 서버가 응답하지 않았지만 403 오류는 웹 배포가 서버에 연결할 수 있지만 요청이 적극적으로 거부되었음을 나타냅니다. 웹 관리 서비스에 대한 HTTP 로그는 요청이 서버에 도달했는지 확인하고 실패한 실제 요청에 대한 세부 정보를 제공하는 데 도움이 될 수 있습니다. 이 로그는 기본적으로 에서 %SystemDrive%\Inetpub\logs\WMSvc 찾을 수 있습니다. 다른 IIS 로그와 마찬가지로 데이터는 로그에 즉시 기록되지 않으므로 요청을 보거나 웹 관리 서비스를 다시 시작하여 로그를 플러시하기 위해 몇 분 정도 기다려야 할 수 있습니다.

로그에서 WMSVC 위에서 언급한 오류는 다음과 같습니다.

2011-06-02 17:59:05 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 - 192.168.0.203 - 403 6 5 1669

6 로그의 후 403 은 하위 상태 코드이며 IP 주소가 거부되었음을 의미합니다. IIS에 대한 상태 및 하위 상태 코드의 전체 목록은 IIS의 HTTP 상태 코드에서 찾을 수 있습니다.

관리 서비스가 원격 연결을 허용하도록 구성되었나요?

이것이 403.6 응답의 가장 가능성이 높은 이유입니다. 관리 서비스 아이콘을 두 번 클릭하고 원격 Connections 사용하도록 설정이 선택되어 있는지 확인합니다. 변경하려면 서비스를 중지해야 하므로 완료되면 다시 시작해야 합니다.

관리 서비스 대화 상자를 보여 주는 스크린샷

Windows 방화벽을 통해 웹 관리 서비스가 허용되었나요?

서버에 웹 관리 서비스를 설치하면 인바운드 방화벽 규칙의 이름이 웹 관리 서비스(HTTP Traffic-In)로 지정됩니다. 고급 보안으로관리 도구Windows 방화벽시작>으로 이동하여 이 규칙이 사용하도록 설정되어 있는지 확인합니다>. 인바운드 규칙을 선택하고 목록에서 웹 관리 규칙을 찾습니다. 모든 프로필에 대해 사용하도록 설정해야 합니다.

타사 방화벽을 사용하는 경우 포트 8172의 인바운드 연결이 허용되는지 확인해야 합니다.

관리 서비스에 대한 IP 제한이 구성되었나요?

403 오류가 발생할 수 있는 다른 일반적인 이유는 관리 서비스가 클라이언트의 IP를 거부하도록 구성된 경우입니다. 기본적으로 원격 연결이 허용되는 한 모든 IP를 허용하도록 구성됩니다. 관리 서비스 아이콘을 두 번 클릭하여 IP 제한을 검사 수 있습니다. 구성된 모든 IP 제한 규칙은 IPv4 주소 제한의 페이지 맨 아래에 있습니다.

(404) 찾을 수 없음

Visual Studio의 오류 목록 페이지를 보여 주는 스크린샷 오류 세부 정보가 포커스에 있습니다.

Web deployment task failed.(Could not connect to the destination computer ("deployserver").
On the destination computer, make sure that Web Deploy is installed and that the required process
("The Web Management Service") is started.
The requested resource does not exist, or the requested URL is incorrect.
Error details: Could not connect to the destination computer ("deployserver").
On the destination computer, make sure that Web Deploy is installed and that the required process
("The Web Management Service") is started.
The remote server returned an error: (404) Not Found.

404 오류는 웹 배포가 서버의 웹 관리 서비스에 연결할 수 있었지만 필요한 항목을 찾을 수 없음을 나타냅니다. 가장 먼저 해야 할 일은 웹 배포가 연결하려고 시도한 리소스를 확인하는 것입니다. 대상 서버의 %SystemDrive%\Inetpub\logs\WMSvc 아래의 웹 관리 서비스 로그를 보면 로그에 WMSVC 다음과 같은 항목이 표시됩니다.

2011-05-12 15:21:50 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 - 192.168.0.203 - 404 7 0 1606

Msdeploy.axd 는 웹 배포 요청에 대한 처리기입니다.

웹 배포가 설치되어 있나요?

프로그램 및 기능 제어판으로 이동하여 설치된 프로그램 목록에서 Microsoft Web Deploy 2.0을 찾아 웹 배포가 설치되었는지 확인할 수 있습니다. 없는 경우 제품 탭으로 이동하여 웹 플랫폼 설치 관리자를 통해 설치할 수 있습니다 . 웹 배포 도구 2.1로 나열됩니다. 또한 웹 Deployment Agent 서비스(MsDepSvc)가 실행 중인지 확인해야 합니다.

웹 배포 처리기가 설치되어 있나요?

웹 배포가 설치되어 있고 이 오류가 계속 발생하면 웹 배포의 IIS 7 배포 처리기 기능이 설치되어 있는지 확인합니다. 프로그램 및 기능 제어판에서 Microsoft Web Deploy 2.0을 찾아 마우스 오른쪽 단추로 클릭하고 변경을 선택합니다. 마법사가 나타나면 첫 번째 페이지에서 다음 을 선택한 다음, 두 번째 페이지에서 변경을 선택합니다. IIS 7 배포 처리기 및 그 아래에 모든 항목을 추가합니다.

Microsoft Web Deploy 2 dot 0 Setup 대화 상자를 보여 주는 스크린샷 웹 배포 프레임워크 강조 표시됩니다.

다음을 선택하여 마법사를 완료합니다. 이 변경 후 웹 관리 서비스를 다시 시작해야 합니다.

(401) 권한 없음

웹 배포 및 웹 관리 서비스가 올바르게 구성되면 사용자가 콘텐츠를 업데이트할 수 있도록 위임 규칙을 설정해야 합니다. 권한 문제의 경우 Visual Studio에서 몇 가지 다른 오류가 표시 될 수 있습니다. 예를 들면

권한 문제 오류를 표시하는 Visual Studio의 오류 목록을 보여 주는 스크린샷

Web deployment task failed.(Connected to the destination computer ("deployserver")
using the Web Management Service, but could not authorize.
Make sure that you are using the correct user name and password, that the site you are connecting
to exists, and that the credentials represent a user who has permissions to access the site.
Make sure the site name, user name, and password are correct. If the issue is not resolved,
please contact your local or server administrator.
Error details:
Connected to the destination computer ("deployserver") using the Web Management Service,
but could not authorize. Make sure that you are using the correct user name and password,
that the site you are connecting to exists, and that the credentials represent a user who
has permissions to access the site.
The remote server returned an error: (401) Unauthorized.

WMSvc 로그에서 다음 메시지를 볼 수 있습니다.

2011-05-12 15:50:12 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 - 192.168.0.203 - 401 2 5 1653
2011-05-12 15:50:12 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 user1 192.168.0.203 - 401 1 1326 124

Visual Studio 출력에서 강조 표시된 http 상태 액세스 거부 오류입니다. 오류 로그의 강조 표시된 win32 상태 "로그온 실패: 알 수 없는 사용자 이름 또는 잘못된 암호"에 매핑되므로 이는 간단한 로그온 실패입니다. 사용자가 인증되었지만 게시하는 데 필요한 권한이 없는 경우 로그 항목은 다음과 같습니다.

2011-05-12 15:55:38 192.168.0.211 POST /msdeploy.axd site=default%20web%20site 8172 - 192.168.0.203 - 401 2 5 0

이 사용자가 게시할 수 있도록 하려면 웹 배포 처리기 구성의 지침에 따라 위임을 설정해야 합니다.

권한이 없는 작업

계정에 로그인할 수 있지만 콘텐츠를 게시하는 데 필요한 권한이 부여되지 않은 경우 다음 오류 메시지를 볼 수 있습니다.

사용자 권한과 관련된 오류를 표시하는 Visual Studio의 오류 목록 페이지를 보여 주는 스크린샷

Web deployment task failed. (Unable to perform the operation ("Create Directory")  for the specified
directory ("bin"). This can occur if the server administrator has not authorized this operation for
the user credentials you are using.

로그에는 WMSvc 이러한 요청에 대한 HTTP 200 응답이 표시됩니다. 다행히 웹 배포 2.1은 Microsoft 웹 배포 서비스 로그에도 정보를 씁니다. 이를 보려면 이벤트 뷰어(로컬)>애플리케이션 및 서비스 로그Microsoft 웹 배포를 > 선택합니다.

이벤트 뷰어 메뉴를 보여 주는 스크린샷 Microsoft 웹 배포가 강조 표시됩니다.

이 특정 오류의 경우 이벤트 로그에 추가 세부 정보가 포함됩니다(간결성을 위해 잘림).

User: DEPLOYSERVER\User1
Client IP: 192.168.0.203
Content-Type: application/msdeploy
Version: 8.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 7.1.1070.1
MSDeploy.Method: Sync
MSDeploy.RequestId: 50de0746-f10d-4640-9b3d-4ba773520e38
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
Skip: objectName="^configProtectedData$"
Provider: auto, Path: 
Tracing deployment agent exception. Request ID '50de0746-f10d-4640-9b3d-4ba773520e38'. Request Timestamp: '5/12/2011 9:18:12 AM'. Error Details:
Microsoft.Web.Deployment.DeploymentDetailedUnauthorizedAccessException: Unable to perform the operation ("Create Directory")
for the specified directory ("C:\inetpub\wwwroot\bin"). This can occur if the server administrator has not authorized this
operation for the user credentials you are using.
---> Microsoft.Web.Deployment.DeploymentException: The error code was 0x80070005. ---> System.UnauthorizedAccessException:
Access to the path 'C:\inetpub\wwwroot\bin' is denied.
   at Microsoft.Web.Deployment.Win32Native.RaiseIOExceptionFromErrorCode(Win32ErrorCode errorCode, String maybeFullPath)
   at Microsoft.Web.Deployment.DirectoryEx.CreateDirectory(String path)
   at Microsoft.Web.Deployment.DirPathProvider.CreateDirectory(String fullPath, DeploymentObject source)
   at Microsoft.Web.Deployment.DirPathProvider.Add(DeploymentObject source, Boolean whatIf)
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---

이 메시지는 이 특정 오류에 대한 권한을 부여해야 하는 위치를 알려줍니다. Visual Studio에서 다음 권한 오류가 표시 될 수도 있습니다.

사용 권한 오류가 포커스가 있는 Visual Studio의 오류 목록 페이지를 보여 주는 스크린샷

Web deployment task failed.((5/12/2011 11:31:41 AM) An error occurred when the request was processed on the remote computer.)

(5/12/2011 11:31:41 AM) An error occurred when the request was processed on the remote computer.
The server experienced an issue processing the request. Contact the server administrator for more information.

이 특정 오류는 계속 진행하는 데 많은 영향을 미치지 않지만 이벤트 뷰어 웹 배포 오류 로그를 보면 그림이 더 명확해집니다.

User: DEPLOYSERVER\User1
Client IP: 192.168.0.203
Content-Type: application/msdeploy
Version: 8.0.0.0
MSDeploy.VersionMin: 7.1.600.0
MSDeploy.VersionMax: 7.1.1070.1
MSDeploy.Method: Sync
MSDeploy.RequestId: 63b2f3d1-1817-444f-8280-9fa4f6f85d53
MSDeploy.RequestCulture: en-US
MSDeploy.RequestUICulture: en-US
Skip: objectName="^configProtectedData$"
Provider: auto, Path: 
Tracing deployment agent exception. Request ID '63b2f3d1-1817-444f-8280-9fa4f6f85d53'. Request Timestamp: '5/12/2011 9:31:41 AM'. Error Details:
System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.
   at System.Security.AccessControl.Win32.SetSecurityInfo(ResourceType type, String name, SafeHandle handle, SecurityInfos securityInformation, SecurityIdentifier owner, SecurityIdentifier group, GenericAcl sacl, GenericAcl dacl)
   at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, SafeHandle handle, AccessControlSections includeSections, Object exceptionContext)
   at System.Security.AccessControl.NativeObjectSecurity.Persist(String name, AccessControlSections includeSections, Object exceptionContext)
   at Microsoft.Web.Deployment.FileSystemSecurityEx.Persist(String path)
   at Microsoft.Web.Deployment.SetAclProvider.Add(DeploymentObject source, Boolean whatIf)
   at Microsoft.Web.Deployment.DeploymentObject.Update(DeploymentObject source, DeploymentSyncContext syncContext)
   at Microsoft.Web.Deployment.DeploymentSyncContext.HandleUpdate(DeploymentObject destObject, DeploymentObject sourceObject)
   at Microsoft.Web.Deployment.DeploymentSyncContext.SyncChildrenOrder(DeploymentObject dest, DeploymentObject source)
   at Microsoft.Web.Deployment.DeploymentSyncContext.ProcessSync(DeploymentObject destinationObject, DeploymentObject sourceObject)

이 출력에서 보안 정보를 설정할 수 있는 권한이 없는 것을 확인할 User1 수 있습니다. 이 경우 사용자에게 콘텐츠에 대한 "권한 수정"이 없습니다. 콘텐츠에 "변경 권한"을 부여하면 문제가 해결됩니다.

기타

.NET 4.0 애플리케이션이 성공적으로 게시된 후 검색할 수 없는 경우 .NET 4.0이 IIS에 올바르게 등록되지 않았을 수 있습니다. 다른 증상은 .NET 4.0이 설치되어 있지만 IIS에는 .NET 4.0 애플리케이션 풀 또는 처리기 매핑이 없다는 것입니다. 이 문제는 IIS가 설치되기 전에 .NET 4.0이 설치될 때 발생합니다. 이 문제를 해결하려면 관리자 권한 명령 프롬프트를 시작하고 다음 명령을 실행합니다.

%systemdrive%\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -iru

추가 정보