I am a bit new to servers and stuff so had a question. I have my development team working on my website. They are in different countries and currently they put all the work live on the test site. But the test site is open to anyone who knows the URL. It is behind a directory but this effects my QA process because i cannot use the accurate URL structures to prevent the general public from seeing it. So what I want to do it:

Have my site live on the net but only for me and my team, so like an internal network. Also I will need to mirror this to my live site when i put it live. So i guess this is something like setting up a staging and live environment.

  1. So how to do it and are both environments on the same physical server or do i need to buy two servers?
  2. And if i setup a staging environment how will i access it and my team since we are all spread out so i assume we need to log into something to access it?
  3. What about the URL - do i need a different URL for the test site or can i use the same live url for the test site?

I plan to get a dedicated server + CDN for my site. Platform is PHP codeignitor and MySQL.


Generally speaking your testing environment should be entirely separate from your production environment -- This allows you to test things like software updates before rolling them out to production, so if they break stuff you can determine what and how to fix it without the time pressures associated with your live environment being down.

My suggestion for an ideal scenario would be to build a development environment that is an exact copy of your production environment - same releases of all software, same database contents, etc. This can be made publicly accessible, or locked away behind a firewall where all your developers & QA folks VPN in to do their work (which way you go depends heavily on your workflow and processes, but I personally like the VPN solution).

It's also often advantageous to build your development environment using something like VMWare, where you can snapshot the environment before making major changes.

You will also need a process in place for promoting your changes to production. If you have the time to invest in a solution like Puppet or radmind now it will make future deployments much easier (VMWare comes in handy here too -- You can test your deployment process on virtual machines and debug it so when it runs in production you know how it will behave).

| improve this answer | |
  • 1
    virtualisation can be a very handy tool in jobs like this. Try making a virtual farm of your production servers, and code against those. – Sirex Feb 16 '11 at 18:10
  • The problem with VM I am seeing is HD space. Unlike dedicated machines where space goes in TB all the hosting ads i am seeing have like 40 to 120 GB HD. That is too small. Need atleast 1 TB space to store all the images and stuff. – Sean Feb 16 '11 at 19:42
  • The usual solution for a development system is to buy your own box and install VMWare on it -- The Free ESXi stuff is usually sufficient. Expect to spend between US $5K and $10K for hardware depending on how much RAM you need in addition to your (apparently massive) disk requirement thouth... – voretaq7 Feb 16 '11 at 21:37

My basic approach has been to have two directories, same physical server.

I setup a separate VirtualHost in apache for dev.sitename.com and www.sitename.com. When I'm satisfied with how something looks on dev, I push the code to www.

Casually I usually do it with a dropbox shared folder and create a symlink to /var/www. This way it's easy for me to modify files and see the results.

If you're working with multiple users, it'd be much better to have a repository with version control for the dev environment. Setup a git server and symlink the repository to apache's http directory.

| improve this answer | |
  • Is it beter to host my own repository in my server or use these 3rd party sites like git or assembla, etc? And which repository is better - svn or cvs? – Sean Feb 16 '11 at 17:00
  • I certainly wouldn't want to dive into a 'which is better' argument... I know that github is intended for public repositories (unless you have a paid account). --- my intuition could be wrong here, but I think it would be more difficult to get a development website linked to an external repository. – Brian Feb 16 '11 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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