如何在Web应用程序运行时将应用程序部署到IIS [英] How Do I deploy an application to IIS while that web application is running
问题描述
我在哪里工作,每当我们知道我们的客户没有使用系统时,我们会在系统中发布错误修复。
试图朝着更好的方向迈进一步服务我想要在应用程序运行时部署到IIS。
想到的一个解决方案是设置两个不同的IIS应用程序,并在部署后使用它们进行切换一个脚本但是我不会尝试这样做,因为我不想在忙碌的时候出现任何并发症。
有没有人在这个部署领域有经验? p>
谢谢
无论您是否使用PHP,ASP, ASP.NET等没有对IIS的事务部署的本机支持。
最简单的方法是拥有两个物理文件夹(可选的两个网站 - 一个制作,一个测试),例如:
c:\websites\myapp\dep1
c:\网站\myapp\dep2
最初,您的网站将其物理路径指向 c:\websites \myapp\dep1
。
部署最新版本时,您将部署到 c:\ websites\myapp\dep2
。完成之后,只需将生产站点的物理路径切换到此文件夹即可。这意味着你仍然拥有原始的网站,如果新的代码出于某种原因而失败。
下次执行部署时,您将部署到一旦完成将生产站点切换到该文件夹, c:\websites\myapp\dep1
您可以选择将测试网站指向您要部署的文件夹,以便在切换生产站点之前确保该网站正常工作。
这可能都是脚本的。
这是一些可能感兴趣的相关阅读:
Rob Conery也有一个很好的关于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:\websites\myapp\dep1 c:\websites\myapp\dep2
Initially your site would have its physical path pointing to c:\websites\myapp\dep1
.
When you deploy your latest build you'd deploy into c:\websites\myapp\dep2
. 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:\websites\myapp\dep1
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:
这篇关于如何在Web应用程序运行时将应用程序部署到IIS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!