简体   繁体   English

通过 MSDeploy.exe 从 WMSvc 获取 404

[英]Getting a 404 from WMSvc via MSDeploy.exe

From Windows 8 to Windows Server 2012 (IIS 8) with Web Management Services installed and working, I can use IIS Manager on W8 box to manage the remote server but I get a 404.7 from WMSvc when I execute the following command:从 Windows 8 到 Windows Server 2012 (IIS 8) 安装并运行了 Web 管理服务,我可以使用 W8 框上的 IIS Manager 来管理远程服务器,但是当我执行以下命令时,我从 WMSvc 得到了 404.7:

msdeploy.exe" -verb:dump -source:contentPath=c:\InetPub\wwwroot,computerName=https://uktnws01:8172/MsDeploy.axd,userName=corp\administrator,password=WMSvcIsCrap,authType=Basic -allowUntrusted

I've tried all sorts of combinations and parameters.我尝试了各种组合和参数。 I can te.net to that port, I know its open.我可以 te.net 到那个端口,我知道它是开放的。

I'm just removing the Management Service feature from Windows and restarting.我只是从 Windows 中删除管理服务功能并重新启动。 I will pour myself a scotch and make some snacks.我会给自己倒一杯苏格兰威士忌,然后做点心。 In the meantime, if you have any ideas, please share.同时,如果您有任何想法,请分享。

Join my live blog below and follow the action.在下面加入我的实时博客并按照操作进行操作。

Update 1更新 1

With Management Service removed, I now get删除管理服务后,我现在得到

Error: Unable to connect to the remote server Error: No connection could be made because the target machine actively refused it 192.168.2.22:8172 Error count: 1.错误:无法连接到远程服务器错误:无法建立连接,因为目标机器主动拒绝它 192.168.2.22:8172 错误计数:1。

Where the 2nd line is a new message.第二行是一条新消息。 Woohoo.哇哦。

Update 2更新 2

Okay, so things are going from bad to worse now.好吧,现在情况越来越糟了。 Since reinstalling, the remote IIS console will alert on the certificate and then say,重新安装后,远程 IIS 控制台将对证书发出警报,然后说:

The server is not accepting remote connections.服务器不接受远程连接。

But I think this is because I probably didn't re-enable Remote Management, on top of installing the damned thing.但我认为这是因为除了安装该死的东西之外,我可能没有重新启用远程管理。

Update 3更新 3

With Remote Management enabled, the remote IIS works again but the 404 has returned.启用远程管理后,远程 IIS 再次工作,但 404 已返回。 Just in the interests of SEO, here's the full error:为了 SEO 的利益,这里是完整的错误:

Error Code: ERROR_DESTINATION_NOT_REACHABLE More Information: Could not connect to the remote computer ("uktnws01"). On the remote computer, make sure that Web Deploy is installed and that the required process ("Web Management Service") is started.  Learn more at http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.
Error: The remote server returned an error: (404) Not Found.
Error count: 1.

Update 4更新 4

Tried the same command against another web server over a VPN to a client and that works a charm.通过 VPN 对客户端尝试对另一台 web 服务器执行相同的命令,这很有用。 Looks like IIS is fubar'ed on my absolutely spanking new 2012 build.看起来 IIS 在我的 2012 年新版本中是错误的。

Update 5更新 5

I enabled failed request tracing for WMSvc and have seen that the 404.7 comes from the RequestFilteringModule module.我为 WMSvc 启用了失败的请求跟踪,并且看到 404.7 来自 RequestFilteringModule 模块。 404.7 is 'File Extension Denied' according to the documentation.根据文档,404.7 是“文件扩展名被拒绝”。

http://www.iis.net/configreference/system.webserver/security/requestfiltering http://www.iis.net/configreference/system.webserver/security/requestfiltering

Adding an explicit server rule for.axd files does not help though.为 .axd 文件添加明确的服务器规则并没有帮助。 Interesting to see this module though since it imposes restrictions on URL length and content sizes.有趣的是看到这个模块,因为它对 URL 长度和内容大小施加了限制。 Can you imagine troubleshooting this in an IIS hosted WCF app.你能想象在 IIS 托管的 WCF 应用程序中解决这个问题吗? Haha.哈哈。 I'm crying really.我真的要哭了。

Update 6更新 6

I'm removing Request Filtering which means removing ASP.NET and various other things also.我正在删除请求过滤,这意味着要删除 ASP.NET 和其他各种内容。 They need a Reinstall Windows Features & Dependencies All In One Hit Because We Write Unreliable Software option.他们需要 Reinstall Windows Features & Dependencies All In One Hit Because We Write Unreliable Software 选项。

Update 7更新 7

I reinstall everything and then some Aussie named Richard appears out of nowhere and totally explains that Web Deploy isn't actually a part of WMSvc as standard, even on IIS 8, and that I need to install Web Deploy.我重新安装了所有东西,然后某个名叫 Richard 的澳大利亚人突然出现,并完全解释说 Web Deploy 实际上不是标准 WMSvc 的一部分,即使在 IIS 8 上也是如此,我需要安装 Web Deploy。

So I do.所以我愿意。 Then I disable MsDepSvc which is the other part it installs (which I thought was the entirety of Web Deploy) because it sucks on port 80 and stops load balancers from seeing a downed IIS service.然后我禁用 MsDepSvc,这是它安装的另一部分(我认为是整个 Web Deploy),因为它占用端口 80 并阻止负载均衡器看到已关闭的 IIS 服务。

And it works.它有效。 I can go to bed.我可以拨打 go 睡觉。

In case someone else is having the same issues than what I am having, I also got the same 404 error.如果其他人遇到与我遇到的问题相同的问题,我也会遇到相同的 404 错误。 The quickest way I found to check was to go on the server itself, and open up "https://<servername>:8172/MsDeploy.axd".我发现检查的最快方法是访问服务器本身,然后打开“https://<servername>:8172/MsDeploy.axd”。 Chrome & Firefox just showed a blank page, so I had to use the Network tab of the developer tools (F12) to see the actual 404 error message. Chrome 和 Firefox 只显示一个空白页面,所以我不得不使用开发人员工具 (F12) 的网络选项卡来查看实际的 404 错误消息。

Somehow, while installing Web Deploy 3.0 from the Web Platform Installer, the IIS 7 Deployment Handler didn't get installed, even though the IIS Manager UI Module did.不知何故,从 Web 平台安装程序安装 Web 部署 3.0 时,IIS 7 部署处理程序没有安装,即使 IIS 管理器 UI 模块安装了。 In my case, I downloaded the Web Deployment Tool Installation.msi from the following link: Web Deployment Tool Installation .就我而言,我从以下链接下载了 Web Deployment Tool Installation.msi: Web Deployment Tool Installation Then I had to go back to IIS Admin Tool (Start -> Run -> inetmgr.exe) > {server name} > click on Management Service icon, and restart the management service before the MsDeploy.axd handler started working.然后我必须返回到 IIS 管理工具(开始 -> 运行 -> inetmgr.exe)> {服务器名称} > 单击管理服务图标,并在 MsDeploy.axd 处理程序开始工作之前重新启动管理服务。

Enabling IIS Deployment Handler + Remote Agent Service启用 IIS 部署处理程序 + 远程代理服务

在此处输入图像描述

Have you installed Web Deploy on the server?您是否在服务器上安装了 Web Deploy? Web Deploy registers a handler (/msdeploy.axd) with WMSVC, so a 404 would be the expected status code if it weren't installed. Web Deploy 向 WMSVC 注册一个处理程序 (/msdeploy.axd),因此如果未安装,404 将是预期的状态代码。

On Windows 2012 R2 Server I followed mga911's advice.在 Windows 2012 R2 Server 上,我遵循了 mga911 的建议。

I was stuck getting deploys working.我被困在部署工作中。 Had installed Web Deploy 3.5 -> Enabled Management Service Delegation -> Ensured Services were started.已安装 Web Deploy 3.5 -> 启用管理服务委派 -> 确保服务已启动。 The problem was the IIS Deployment handler had not been installed.问题是尚未安装 IIS 部署处理程序。 Going through Web PI 4.6 I was not given the opportunity to install the IIS deployment handler.通过 Web PI 4.6,我没有机会安装 IIS 部署处理程序。 You need to go into the control panel -> Programs and Features Change Web Deploy 3.5's installation.您需要进入控制面板 -> 程序和功能更改 Web Deploy 3.5 的安装。 Please note my instructions.请注意我的指示。 In the change process it indicates all the sub packages will be installed but the text message says 0 of 3 sub components will be installed.在更改过程中,它指示将安装所有子包,但文本消息显示将安装 3 个子组件中的 0 个。 One of those components is the IIS handler.这些组件之一是 IIS 处理程序。 Read carefully because I didn't and was frustrated:)仔细阅读因为我没有并且很沮丧:)

  • Control Panel > Programs and Features控制面板 > 程序和功能
  • Right Click on Microsoft Web Deploy 3.5右键单击 Microsoft Web Deploy 3.5
    • Select Change > click next > click change选择更改 > 单击下一步 > 单击更改
    • You'll notice when Web Deployment Framework is selected you'll see in the message "It has 0 of 3 subfeatures selected" You'll notice when Web Deployment Framework is selected you'll see in the message "It has 0 of 3 subfeatures selected"
    • Click on drop down select "Entire feature will be installed on local hard drive"单击下拉菜单选择“整个功能将安装在本地硬盘上”
    • Next > Change >Finish下一步 > 更改 > 完成

One important point I think is that you have to turn on the Management service first and then install Web Deploy.我认为很重要的一点是,您必须先打开管理服务,然后再安装 Web Deploy。

I did it the other way around and it didn't work.我反过来做了,但没有用。

Only by reinstalling Web deploy did it start working.只有通过重新安装 Web 部署它才开始工作。

When I installed Web Deploy via the web platform installer the Handler was not selected.当我通过 Web 平台安装程序安装 Web Deploy 时,未选择 Handler。 I had to manually install Web Deploy 3.0, click"change" and then select the Handler to be installed.我不得不手动安装 Web Deploy 3.0,单击“更改”,然后选择要安装的 Handler。

After hours of searching, doing your solution below worked for me !!经过数小时的搜索,在下面执行您的解决方案对我有用!

Control Panel > Programs and Features Control Panel > 程序和功能

Right Click on Microsoft Web Deploy 3.5右键单击 Microsoft Web Deploy 3.5

Select Change > click next > click change选择更改 > 单击下一步 > 单击更改

You'll notice when Web Deployment Framework is selected you'll see in the message您会注意到何时选择Web部署框架,您将在消息中看到

 "It has 0 of 3 subfeatures selected"

Click on drop down select "Entire feature will be installed on local hard drive"单击下拉菜单选择"Entire feature will be installed on local hard drive"

Next > Change >Finish下一步 > 更改 > 完成

In my case, when installing the web deploy 3.0 package through the web pi i never got the Management Service Delegation option in IIS /home.. reinstalling it rectified the issue however, thus resolving Resolved my 404.7 error.在我的例子中,当通过 web pi 安装 web deploy 3.0 包时,我从未在 IIS /home 中获得管理服务委派选项。但是重新安装它纠正了这个问题,从而解决了我的 404.7 错误。

This was under Microsoft Server 2012 and IIS8这是在 Microsoft Server 2012 和 IIS8 下

Edit: I just recently tried the very same thing on Windows 8 and would like to point out that the microsoft website states:编辑:我最近在 Windows 8 上尝试了同样的事情,并想指出微软网站上的声明:

You cannot set up remote publishing using Web Deploy for a site that is hosted in IIS on Windows 8.0 or 8.1.对于在 Windows 8.0 或 8.1 上的 IIS 中托管的站点,您无法使用 Web 部署设置远程发布。 The reason is that the client SKUs for Windows do not come with the Web Management Service that is required for remote connections.原因是 Windows 的客户端 SKU 没有附带远程连接所需的 Web 管理服务。 As a result, on Windows 8.0 or 8.1, the IIS Manager Permissions icon and the Configure Web Deploy Publishing deployment option that are required to configure remote publishing are not available in the IIS Manager.因此,在 Windows 8.0 或 8.1 上,配置远程发布所需的 IIS 管理器权限图标和配置 Web 部署发布部署选项在 IIS 管理器中不可用。 http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy-on-iis-80-or-later#00 http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy-on-iis-80-or-later#00

(Yes i realize the target is Server 2012 in the question but this could save a lot of people from having the same headache as me, since this worked just fine on my old dev machine i wanted to let people know.) (是的,我知道问题中的目标是 Server 2012,但这可以让很多人免于像我一样头疼,因为这在我的旧开发机器上工作得很好,我想让人们知道。)

Rather than using Web Platform Installer.而不是使用 Web 平台安装程序。 Download the WebDeploy.exe from the website and install it on server with Complete package option.从网站下载 WebDeploy.exe 并使用 Complete package 选项将其安装在服务器上。

It will fix the issue.它会解决这个问题。

Additionally you might need to grant access for the Web Management Service此外,您可能需要授予 Web 管理服务的访问权限

I also had the problem of Visual Studio (2013) couldn't update the app on my server (Windows 2012 R2 IIS 8.5).我还遇到了 Visual Studio (2013) 无法更新服务器上的应用程序 (Windows 2012 R2 IIS 8.5) 的问题。 I added the components manually as described above, but that didn't solve the problem.我如上所述手动添加了组件,但这并没有解决问题。 Then I found this article .然后我找到了这篇文章

It basically says that the Web Management Service is logged on as Local Service which doesn't have access rights to the Inetpub directory.它基本上表示 Web 管理服务作为本地服务登录,它没有访问 Inetpub 目录的权限。 Granting permissions for Local Service solved the problem for me.授予本地服务权限为我解决了这个问题。

I have got the same issue.我有同样的问题。 I resolved this by "Restart-Service wmsvc".我通过“Restart-Service wmsvc”解决了这个问题。

This issue still exists in server 2019 as well.服务器 2019 中也仍然存在此问题。 Need to install web deployed in the correct sequence需要安装以正确顺序部署的web

  • first, start the service - web management service一、启动服务——web管理服务
  • then install the web deploy (download from Microsoft web site)然后安装网络部署(从微软网站下载)

In my case, using http://<server_address> instead of https://<server_address> in Server field (1st item in publish settings dialog) worked.就我而言,在服务器字段(发布设置对话框中的第一项)中使用http://<server_address>而不是https://<server_address>有效。

Used only windows auth.仅使用 Windows 身份验证。 Web deploy 3.5.网络部署 3.5。 And only the WMSVC certificate which is set in the Management Service icon of the top level server icon.并且只有在顶级服务器图标的管理服务图标中设置的 WMSVC 证书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM