简体   繁体   English

部署Zend Web应用程序的最佳方式

[英]Best Way to Deploy Zend Web Application

I've read a lot about deploying applications here, but haven't found a suitable answer to our needs yet. 我已经阅读了很多关于在这里部署应用程序的内容,但还没有找到适合我们需求的答案。

We have a large web application built with the zend framework that we want to deploy to a remote server. 我们有一个使用zend框架构建的大型Web应用程序,我们希望将其部署到远程服务器。 We want to be able to easily and safely deploy a new version of our application to our production server. 我们希望能够轻松安全地将新版本的应用程序部署到我们的生产服务器。

What needs to be done is the following: 需要做的是以下内容:

  • put up a maintenance page on the production application? 在生产应用程序上建立维护页面?
  • export version from SVN 从SVN导出版本
  • run a shell script to minify the CSS files in a certain directory (shell script is done) 运行shell脚本来缩小某个目录中的CSS文件(shell脚本完成)
  • set file permissions on files and directories 设置文件和目录的文件权限
  • copy/sync? 复制/同步? files to a production server -> only changed files? 文件到生产服务器 - >只更改文件?
  • remove maintenance page from the production application? 从生产应用程序中删除维护页面?

We use SVN as a code versioning tool and we are running CentOS as our server OS in production. 我们使用SVN作为代码版本控制工具,我们将CentOS作为生产中的服务器操作系统运行。

I've read about: 我读过:

  • rsync rsync的
  • fredistrano / capistrano 弗雷德斯特拉诺/卡皮斯特拉诺
  • phing phing
  • custom shell scripts 自定义shell脚本

What are your advices for easy one-click deployment? 您对轻松一键部署的建议是什么?

I export (or checkout) a copy of the site under a different name (typically the subversion revision number & date) and symlink the document root into place 我以不同的名称(通常是颠覆版本号和日期)导出(或签出)该站点的副本,并将文档根目录符号链接到位

1000.20100515/
   application/
   public/
   library/
1020.20100621/
current (symlink to 1000.20100515/)
dev (symlink to 1020.20100621/)

# copy whatever 'dev' points to as the new 'current' symlink.
rm current && cp -d dev current

The document root is set in apache to ../current/public 文档根目录在apache中设置为../current/public

With this, I can check out a new version of the site at leisure, and put the new version live en-mass in a fraction of a second. 有了这个,我可以在闲暇时查看该网站的新版本,并将新版本的实时内容放在几分之一秒内。 Rolling back to a previous version of the site is as easy as changing the symlink - should a major problem be found. 回滚到以前版本的网站就像更改符号链接一样简单 - 如果发现一个主要问题。

Added The ruby-based tool ' Capistrano ' can be an excellent method to fully automate this across a number of machines (be it one, or a dozen), and indeed it's my preferred method of deployment now. 添加基于ruby的工具' Capistrano '可以是一种很好的方法,可以在许多机器上完全自动化(无论是一个还是十几个),实际上它现在是我首选的部署方法。 Capifony is a plugin for Capistrano that also supports Composer -based projects. Capifony是Capistrano的插件,也支持基于Composer的项目。

Try Capistrano. 试试Capistrano。 It is developed for Ruby and you need to have Ruby installed on your computer, but it is not necessary to have it on the target server. 它是为Ruby开发的,你需要在你的计算机上安装Ruby,但没有必要在目标服务器上安装它。

It works with git or svn, and it creates versions on the target server. 它适用于git或svn,并在目标服务器上创建版本。 You can roll back and deploy your new version with one line of CMD. 您可以使用一行CMD回滚和部署新版本。

I have found this tutorial: http://tfountain.co.uk/blog/2009/5/11/zend-framework-capistrano-deployment 我找到了这个教程: http//tfountain.co.uk/blog/2009/5/11/zend-framework-capistrano-deployment

You have a modified version of capistrano with another tutorial here: http://www.codewithstyle.eu/2011/05/03/deploying-zend-framework-applications-using-capistrano/ 你有一个修改版的capistrano与另一个教程: http//www.codewithstyle.eu/2011/05/03/deploying-zend-framework-applications-using-capistrano/

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

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