2011-11-30 107 views
68

我們有一個Web應用程序在Intranet上工作,我試圖使用Visual Studio 2010將它發佈到Internet。目標服務器正在運行iis7並且Web管理服務正在運行。MsDeploy返回403禁止

在Visual Studio 2010中我的服務網址是:

https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd

而且網站/應用程序是:

Default Web Site/WebApp

標記爲IIS應用程序的目的和不受信任的證書被選中,我使用一個管理帳戶。

Visual Studio中返回以下錯誤:

Start Web Deploy Publish the Application/package to https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default%20Web%20Site ... C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets(3588,5): Error : Web deployment task failed.(Remote agent (URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default Web Site) could not be contacted. Make sure the remote agent service is installed and started on the target computer.)

Remote agent (URL https://xxx.xxx.xxx.xxx:8172/MsDeploy.axd?site=Default Web Site) could not be contacted. Make sure the remote agent service is installed and started on the target computer. An unsupported response was received. The response header 'MSDeploy.Response' was '' but 'v1' was expected. The remote server returned an error: (403) Forbidden.

任何想法如何發佈它沒有一個有效的SSL證書?

+0

我得到相同的錯誤。有沒有人有辦法解決嗎? –

回答

180

如果你進入IIS,在「連接」列表
單擊服務器節點上,
雙擊「管理服務」,那麼你帶到它有一個「啓用遠程連接」複選框的屏幕。
由於服務正在運行,此複選框(以及屏幕的其餘部分)可能會變灰。只需點擊操作窗格中的「停止」鏈接,然後選中「啓用遠程連接」框以及您想要在此更改的其他設置,然後再次單擊「操作」窗格上的「應用」和「開始」。

這應該有希望讓您用正確的證書連接到遠程機器的服務。 (如果打開了正確的端口和東西,並且所有的爵士樂。)

我認爲這有助於您的情況。至少你不會得到403的,但你可能有其他的MsDeploy錯誤。

+3

我有同樣的問題。我相信我的配置在配置更改期間由於硬重啓而損壞。我採取了這些步驟,但沒有改變任何東西。 (僅將auth更改爲Windows,應用,然後返回到Windows + ISS管理器)。這爲我修好了。 –

+0

@KaseySpeakman謝謝。有些服務安裝方式和/或IIS管理器出於某種原因需要這樣做。也許配置不會被重置,除非檢測到更改。最後,在來回翻動auth後重新啓動服務,然後像你所建議的那樣開始工作。 (只重新啓動服務不起作用。) – ulty4life

+0

@KaseySpeakman同樣在這裏。 – cederlof

2

我有同樣的問題。談論鐵圈跳... 解決方案需要設置的用戶和部署權限等

  1. 得到錯誤後,「NOT FOUND」通過上述吉汗Yakar 所預測的時候,我不得不改變webdeploy(用於我需要重新下載搜索'WebDeploy_x64_en-US.msi') 啓用所有選項。
  2. 收到了一個新錯誤,總是很好,ERROR_USER_NOT_AUTHORIZED_FOR_CONTENTPATH。爲此,我查看了Web部署錯誤(請參閱下面的鏈接)。

Diagnosis - A non-administrative user attempted to perform an operation with a Web Deploy provider for which the user is not currently authorized. Resolution - Web Deploy 2.0 setup, by default, creates Management Service Delegation Rules which allow non-administrators to perform operations with this provider. It is possible that a delegation rule required for this provider has not been setup correctly. Workaround: From the Programs Control Panel, run Repair on Web Deploy 2.0. Alternatively, create the delegation rule manually.

事實證明,我不得不從「配置Web部署處理程序」手動創建(見下面的鏈接),使用本指南「配置WMSVC和IIS管理器權限」和「創建委託規則對於Web Deploy Users'排序問題。

注意事項: 使用「網絡部署的錯誤代碼」從診斷: http://www.iis.net/learn/publish/troubleshooting-web-deploy/web-deploy-error-codes 和最終配置爲使用流程從「配置Web部署處理程序」: http://www.iis.net/learn/publish/using-web-deploy/configure-the-web-deployment-handler

+1

在一篇文章解決了所有的問題序列,這有助於。此外還有另一項解決方法,我卸載了Web部署並重新安裝了IIS:來自Web Platform Installer的推薦配置。 – Srini

0

Web部署可以給你一大堆的錯誤如果安裝不正確。幫你自己一個忙並使用網絡平臺安裝程序https://www.microsoft.com/web/downloads/platform.aspx)。如果您已經嘗試安裝它,您應該首先卸載WebDeploy。從WebPI中選擇:「Web Deploy 3.6 for Hosting Servers」。