2011-11-30 147 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”。