如何使用 msdeploy 在 IIS 6.0 上部署网站
我在源服务器上的共享位置有一个 zip 文件,我想使用 msdeploy 将其复制到目标服务器。但是,如果第一次该站点在目标服务器上不存在,那么它也应该创建该网站。源服务器和目标服务器都是 Windows Server 2003 上的 IIS 6.0。
我尝试使用不同的提供程序组合,例如
msdeploy.exe -verb:sync -source:package="\\SourceServer\WebSites\Site1.zip" -dest:metakey="Site1"
我收到以下消息:
错误:源 (contentPath) 和目标 (metaKey) 与给定操作不兼容。
我还尝试首先从默认网站在目标上创建网站,然后复制文件,但后来我不知道如何使新网站 Site1 指向这个新目录:
msdeploy.exe -verb :sync -source:metakey="默认网站" -dest:metakey="Site1"
msdeploy.exe -verb:sync -source:package="\\SourceServer\WebSites\Site1.zip" -dest:contentpath="\\DesitnationServer\WebSites\Site1"
- 如何让新网站Site1指向新目录“\DesitnationServer\WebSites\Site1”?
即使我按照上述步骤操作,我也不想每次部署 Site1 时都执行步骤 1 和 2。
我确信一定有一种简单的方法可以做到这一点?有什么想法吗?
I have a zip file on source server in a shared location and, using msdeploy, I would like to copy it to the destination server. However, if for the first time, the site does not exist on the destination server, then it should create the website as well. Both source and destination servers are IIS 6.0 on Windows Server 2003.
I have tried using different combination of providers e.g.
msdeploy.exe -verb:sync -source:package="\\SourceServer\WebSites\Site1.zip" -dest:metakey="Site1"
I am getting the following message:
Error: Source (contentPath) and destination (metaKey) are not compatible for the given operation.
I have also tried creating the website on the destination first from the default website, then copy the files across, but then I don't know how to make the new website Site1 point to this new directory:
msdeploy.exe -verb:sync -source:metakey="Default Web Site" -dest:metakey="Site1"
msdeploy.exe -verb:sync -source:package="\\SourceServer\WebSites\Site1.zip" -dest:contentpath="\\DesitnationServer\WebSites\Site1"
- How to make the new website Site1 point to the new directory "\DesitnationServer\WebSites\Site1" ?
Even if I follow the above steps, I do not want to perform step 1 and 2 everytime I deploy Site1.
I am sure there must be an easy way to do this? Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题!
此处有关于您想要执行的操作的演练< /a>.尝试一下!
(跳到最底部部分,找到与您想要执行的操作最相似的部分:“可选 - 使用包文件将您的站点同步到目标”)
Problems!
There's a walkthrough of what you want to do here. Give that a try!
(Skip to the bottom-most section for the bit that most closely resembles what you're trying to do: "Optional - Synchronize your site to the target by using a package file")
您必须将 iisApp MSDeploy 提供程序与目标一起使用。 iisApp 提供程序与 IIS 6 和 7 兼容,而 appHostConfig 仅与 IIS 7 兼容。所以尝试下面的方法
You have to use iisApp MSDeploy provider with destination. iisApp provider is compatible with both IIS 6 and 7 whereas appHostConfig is compatible with IIS 7 only. So give the below a try