首页 > 解决方案 > MSDeploy 无法远程服务器

问题描述

我有两台机器,第一台是我的开发机,第二台是远程的测试机。我在两者上都安装了 IIS 和 web 部署。当我在我的开发和测试机器上使用 msdeploy 命令进行本地部署时,我的部署是成功的。但是,当我从开发机器部署到远程测试机器时,我收到如下错误:

Error Code: ERROR_DESTINATION_NOT_REACHABLE
More Information: Could not connect to the remote computer ("some-remote- server"). 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: Unable to connect to the remote server
Error: No connection could be made because the target machine actively refused it 10.111.32.57:8172
Error count: 1.

我正在运行以下 msdeploy 命令:

C:\"Program Files (x86)"\IIS\"Microsoft Web Deploy V3"\msdeploy.exe -verb:sync -source:package="test.zip" -dest:auto,ComputerName="https://some-remote-machine:8172/MsDeploy.axd" -setParam:name="IIS Web Application Name",value="Default Web Site/Admin"

标签: .netiisdeploymentmsdeploy

解决方案


首先,确保您在两台机器上都安装了管理服务。

在此处输入图像描述

它正在运行并设置 Windows 和 iis 凭据。

在此处输入图像描述

并打开8172端口。

将 iis 管理器用户设置为坐级。

在此处输入图像描述

配置 Web 部署发布设置。

在此处输入图像描述

您将在配置中找到目标 URL:

在此处输入图像描述

以管理员身份运行命令提示符并运行以下命令:

C:\Program Files (x86)\IIS\Microsoft Web Deploy V3>msdeploy.exe -verb:sync -source:package="c:\abc.zip" -dest:iisApp="authapp/app1",ComputerName="https://servername:8172/msdeploy.axd",UserName='server\Administrator',Password='password',AuthType='Basic' -allowUntrusted

或者

C:\Program Files (x86)\IIS\Microsoft Web Deploy V3>msdeploy.exe -verb:sync -source:iisApp="C:\inetpub\wwwroot\sitea" -dest:iisApp="authapp/app1",ComputerName="https://server:8172/msdeploy.axd",UserName='server\Administrator',Password='password',AuthType='Basic' -allowUntrusted

推荐阅读