Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. 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 one Linux VPS server for my company and we develop PHP sites. What i normally do is just make the subdomain of main site like and work on that till it finishes. and then chnage the domain name.

I have heard that big companies have the staging server and production server.

I just want to know how that system works and when site is complete how do they transfer the site via FTP , SSH , RSYNC , what they do with old staging server.

I jsut want to implement the enterprise strategies in my company and want to know how to proceed


share|improve this question

migrated from May 31 '11 at 16:56

This question came from our site for professional and enthusiast programmers.

It is fairly common to make an install package for the site (e.g. as an RPM). When it is ready for testing in a staging environment, that RPM gets installed on the staging server. When it is tested, it is installed on the live server.

The old staging server then sits there running the same version of the site as the live system until a new build is ready for testing on stage.

share|improve this answer
I was thinking of just copy the public_html folder and FTP to production server. What is the difference in making the RPM than FTP the files or just copy the tar ball of staging site. i want to know the advantages of RPM. i haven't used it – user776358 May 31 '11 at 6:54
RPMs (or any other decent package management system) allow you to specify dependancies, easily rollback to earlier versions, and set up a central package repository in which you can use tools such as yum to install a package and all its dependancies across a network with a single command (which is very useful when you have to install the software on multiple servers in a narrow window) – Quentin May 31 '11 at 8:45
@user: It's better to have an package that you can quickly deploy. Even if it's just a tarball or a zip file, it'll make your deployments smoother, and you won't have to think if you have to restore the code from backup (thinking in a disaster situation is to be avoided if possible). – Satanicpuppy May 31 '11 at 17:05
What is the diff between package and tar file. Is it same . i usually copy the tar.gz file from test and then extract the contents on production . is there any better way – user776358 Jun 1 '11 at 8:03
I refer you to my previous comment. Everything it says is provided by packages and not provided my plain tarballs. – Quentin Jun 1 '11 at 8:52

When you are looking for lightweight solution, this is what I usually do.

  1. setup subdomains and server
  2. sync static files
  3. sync database


When setting up subdomains, it is better to have at least three.

  • Production Server (www): Where everyone access.
  • Staging Server (wwwstaging): Where your client checks before publish.
  • Testing Server (wwwtest): This is developer's playground to test new frameworks, libraries, and so on...

If your web server is strong enough to handle website loads, just put these subdomains in Apache VirtualHost and create according directory in Linux file structure.

Sync static files

Syncing static files are painful when you're uploading via FTP, so it's better to use private repository with GitHub or BitBucket.

Sync database

When you are separating database, you also need to sync them. I don't know how to automate this task, therefore I often sync them manually, or use Production Server when editing.

share|improve this answer

At the moment we are creating a building and deploying pipeline using Maven for PHP, Hudson CI and Phing.

Our goal is create an automated build and deployment process without any intervention of the developers. The only thing they have to do is to release a test or production version. Hudson and the Phing scripts should do the rest automatically.

share|improve this answer
Can i implement it on my VPS . or i need more than one machine. Can you give me more insight how to accomplish this. If thats your company code then leave othwise please guide me , i want to do something like that but i don't have much knowledge of above stuff but i can learn anything provided i have resources and directions. Reagrding the pipeline u were talking about , in which language did u build it.i mean php python bash. i definitely want to do that – user776358 May 31 '11 at 6:53
I'll write an extensive blog post about it later this week. There are many things involved which I can't explain in a single comment. – pderaaij May 31 '11 at 7:00
thanks for that . Can u give me the blog address i will watch for that – user776358 May 31 '11 at 7:25

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.