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

发布于 2024-09-03 02:12:13 字数 530 浏览 3 评论 0 原文

我在这里阅读了很多有关部署应用程序的内容,但尚未找到满足我们需求的合适答案。

我们有一个使用 zend 框架构建的大型 Web 应用程序,我们想要将其部署到远程服务器。我们希望能够轻松、安全地将应用程序的新版本部署到生产服务器。

需要做的是:

  • 在生产应用程序上放置一个维护页面?
  • 从 SVN 导出版本
  • 运行 shell 脚本来缩小某个目录中的 CSS 文件(shell 脚本已完成)
  • 设置文件和目录的文件权限
  • 复制/同步?文件到生产服务器 ->仅更改文件?
  • 从生产应用程序中删除维护页面?

我们使用 SVN 作为代码版本控制工具,并在生产中运行 CentOS 作为服务器操作系统。

我读过:

  • rsync
  • fredistrano / capistrano
  • phing
  • 自定义 shell 脚本

对于轻松的一键部署,您有什么建议?

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. 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
  • run a shell script to minify the CSS files in a certain directory (shell script is done)
  • 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.

I've read about:

  • rsync
  • fredistrano / capistrano
  • phing
  • custom shell scripts

What are your advices for easy one-click deployment?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

顾忌 2024-09-10 02:12:13

我以不同的名称(通常是 subversion 修订版号和日期)导出(或签出)站点的副本,并将文档根符号链接到位

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

文档根在 apache 中设置为 ../current/public

有了这个,我可以闲暇时查看网站的新版本,并在不到一秒的时间内将新版本全部上线。如果发现重大问题,则回滚到网站的先前版本就像更改符号链接一样简单。

添加了基于 ruby​​ 的工具“Capistrano”可以是一个很好的方法在多台机器(无论是一台还是十几台)上完全自动化,实际上这是我现在首选的部署方法。 Capifony 是 Capistrano 的插件,也支持 基于 Composer 的项目。

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

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. Capifony is a plugin for Capistrano that also supports Composer-based projects.

心不设防 2024-09-10 02:12:13

尝试卡皮斯特拉诺。它是为 Ruby 开发的,您需要在计算机上安装 Ruby,但不需要在目标服务器上安装它。

它与 git 或 svn 一起使用,并在目标服务器上创建版本。您可以使用一行 CMD 回滚并部署新版本。

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

您有 capistrano 的修改版本,其中包含另一个教程:http://www.codewithstyle.eu/2011/05/03/deploying-zend-framework-applications-using-卡皮斯特拉诺/

Try 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.

It works with git or svn, and it creates versions on the target server. You can roll back and deploy your new version with one line of CMD.

I have found this tutorial: 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文