Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a CVS on Debian and apache/PHP/MySql. I remember when i worked in a team over the net a wile ago, that after commit i could see the changes on the web server in the php application.

How can I achieve this?


share|improve this question
up vote 1 down vote accepted

You'd need a Post-commit hook to update (cvs update) /var/www or wherever your DocumentRoot is.


If it's not a development server only, then it's an exceptionally bad idea. It only takes a second to commit non-working code, then you're website's buggered.

The smart play in this situation, I think, is to use something like Hudson CI server, and run a bunch of PHP tests, with lint, PHPUnit and Selenium before updating the DocumentRoot with new code.

Another valid option is only to allow the DocumentRoot to be updated if the latest release is "tagged", so that the tagging is a manual process, and only takes place after the code has been reviewed / tested.

share|improve this answer
Yes this is a dev server, it is available in intranet only. – Dr Casper Black Jan 31 '11 at 10:42

This can be done by having a script to automatically publish your repo to the web server every X minutes, this script should only check that changes have happened to the repository and proceed to deploy it.

This is very useful for development scenarios, be aware though that automatic deployment is really not recommended for prod (I know you're not asking for that, it's just a recommendation)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.