简体   繁体   中英

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

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.

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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