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

There's a web application that needs to be deployed on a remote server. There's a scp access to this server, no working shell though, so can't just ssh there.

The question that appeared was how to deploy the application there? Deploy, as run a prepared script that does some tasks like updating DB-schema, restarting the server, clearing caches, etc?

One thing that came to my mind was to copy all the files via scp, then ping some URL on the destination machine (like - or any random characters there) that would fire a deployment script out there. This would require to have probably some IP-based limitations, just so not everyone entering this url fires up the deploy script (to avoid possible DOS attacks).

Another way would be to put a simple check in destination machine's cron and fire it like every 1 minute. In this case the deployment process would look like this:

  • we copy whole application to production server, then copy a specific file, like also
  • cron job checks if exists and deploy.lock doesn't. If so, it creates a lock file (deploy.lock) and starts a deployment script.
  • after a deployment script finishes running, both and deploy.lock are deleted.

What do you think about those 2 ideas? Any more ideas about it too? I'd like to find the best (as most secure for possible screws-up and from any way od DOSing the production server) way to deploy it...

share|improve this question
up vote 1 down vote accepted

We do something similar to your first suggestion

We zip everything up, copy it across and then ping a password protected website that is only internally accessible to unzip over the top of the old site. We run sql scripts after the zip copy but before the unzip.

Either way you have suggested sounds like they will work but as you mentioned, if you have an externally accessable deploy url, you better make very sure it's secure enough.

share|improve this answer

Your first idea involve that the user account for the webserver have suficient privileges to do the deployment task, and that the web server is not chrooted. If these requirements are meet i think it's pretty good idea if the script gets deleted upon completion.

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.