如何在 Web 应用程序运行时将应用程序部署到 IIS [英] How Do I deploy an application to IIS while that web application is running

查看:29
本文介绍了如何在 Web 应用程序运行时将应用程序部署到 IIS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我工作的地方,当我们知道客户没有使用系统时,我们每天晚上都会向系统发布错误修复程序.

尝试向更好的服务迈出一步,我想在应用程序运行时部署到 IIS.

想到的一个解决方案是设置两个不同的 IIS 应用程序,并在使用脚本部署后切换它们.但我不打算尝试这个,因为我不想在我们繁忙的时间出现任何复杂情况.

有人有这方面的部署经验吗?

谢谢

解决方案

无论您使用的是 PHP、ASP、ASP.NET 等,都没有对 IIS 上的事务部署的本机支持.

最简单的方法是在您的网络服务器上有两个物理文件夹和(可选的两个网站 - 一个生产,一个测试),例如:

<前>c:网站我的应用程序dep1c:网站我的应用程序dep2

最初,您的站点的物理路径将指向 c:websitesmyappdep1.

当您部署最新版本时,您将部署到 c:websitesmyappdep2.完成后,只需将生产站点的物理路径切换到此文件夹即可.这意味着您仍然拥有原始站点,并且可以在新代码因任何原因失败时回退到该站点.

下次进行部署时,您将部署到 c:websitesmyappdep1,完成后将生产站点切换到该文件夹​​.

您可以选择有一个指向您要部署到的文件夹的测试站点,以便在切换生产站点之前确保该站点正常工作.

这一切都可以编写脚本.

以下是一些您可能感兴趣的相关阅读:

<块引用>

发布/上传新的 DLL 到 IIS:网站在上传时关闭

是否可以顺利部署组件化的 ASP.NET MVC 应用程序?

Rob Conery 也有一篇很棒的博客文章,内容是关于 ASP.NET 应用程序缺乏一个像样的部署故事.您应该仔细浏览评论,其中一些非常有见地:

<块引用>

ASP.NET 部署需要修复

在 ASP.NET 部署中取得建设性

Where I work, we release bug fixes in to the system every night when we know our clients are not using the system.

Trying to take a step towards better service I'd like to deploy to IIS while the application is running.

A solution that comes to mind is to setup two different IIS applications and switch them over after deploy using a script. But I'm not going to try this out as I don't want any complications during our busy hours.

Does anyone have experience in this area of deployment?

Thanks

解决方案

Regardless of whether you're using PHP, ASP, ASP.NET etc there is no native support for transactional deployment on IIS.

The simplest approach would be to have two physical folders and (optionally two web sites - one production, one test) on your web server, for example:

c:websitesmyappdep1  
c:websitesmyappdep2

Initially your site would have its physical path pointing to c:websitesmyappdep1.

When you deploy your latest build you'd deploy into c:websitesmyappdep2. Once you're done just switch the physical path of the production site over to this folder. This means you still have the original site and can fall back to it if the new code fails for whatever reason.

The next time you do a deployment you'd deploy into c:websitesmyappdep1 and once you're done switch the production site to that folder.

You could optionally have a test site that points to the folder you're deploying to so you can make sure the site works before switching your production site over.

This could all be scripted.

Here's some related reading that may be of interest:

Publishing/uploading new DLL to IIS: website goes down whilst uploading

Is smooth deployment possible with componentized ASP.NET MVC apps?

Rob Conery also had an excellent blog post about the lack of a decent deployment story for ASP.NET application. You should take a trawl through the comments some of which are quite insightful:

ASP.NET Deployment Needs To Be Fixed

Getting Constructive On ASP.NET Deployment

这篇关于如何在 Web 应用程序运行时将应用程序部署到 IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆