Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying to multiple servers

Tags:

php

deployment

I have to deploy my php/html/css/etc code to multiple servers and i am looking at my options for software that allows easy and secure deployment to multiple servers.

Also helps if it could be tied into my SVN.

Any suggestions?

like image 790
Matthew Encinas Avatar asked Sep 18 '08 20:09

Matthew Encinas


4 Answers

Capistrano is pretty handy for that. There's a few people using it (1, 2, 3) for deploying PHP code as evidenced by doing a quick search.

like image 66
Aeon Avatar answered Oct 22 '22 01:10

Aeon


Setting up password-less publickey authentication with ssh would allow you to scp your files to any of your servers very quickly (or be automated by a shell script).

Here's a simple tutorial: http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/internet/node31.html

like image 36
Lee H Avatar answered Oct 22 '22 00:10

Lee H


If you're running on Redhat or Debian, consider packaging up your code into RPM's or Debs. Then build a yum or dpkg repository and put your packages there. You can then use your system's package management to do upgrades/rollbacks, etc. You can even use puppet to automate the process.

If you want to tie it into subversion, you can create a branch for each new version. Use the commit scripts to build the RPM's when a new branch shows up in a directory.

like image 2
Gary Richardson Avatar answered Oct 22 '22 00:10

Gary Richardson


I'll second Capistrano. It's incredibly powerful and flexible. Our current project uses Capistrano for deploying to different servers as well as multiple servers. We pass two arguments to the cap command: 1) the name of the set of machine specific config options to run and 2) the name of the action to run

ends up looking like this:

cap -f deploy.rb live deploy

or

cap -f deploy.rb dev deploy

Of course the default use case - deploy to lots of machines at once - is a doddle with Capistrano AND you don't need to have Capistrano on the machines you are deploying to. All in all, tasty technology.

like image 2
reefnet_alex Avatar answered Oct 22 '22 00:10

reefnet_alex