Managing different Environments with a single server

Hey guys.

I’m a bit new to these stuffs so pardon my ignorance.

I am working on a web application and i have 4 environments; development, testing, staging and production. and i have only 1 server.

I would like to know what is the best way to manage these 3 environments on 1 server which i guess should be as follows:

  • Production can be accessible to everyone

  • testing and staging should be accessible to only certain users.

So how would you guys manage these environments?

I was thinking about allowing from a list of ips in my virtual hosts but the users might not have a static ip address.

Any suggestion?

I don’t see how this question relates to installation and setup of Yii framework.

You can create several subdomains like:

testing1.mywebsite.com

stagging.mywebsite.com

development.mywebsite.com

ahggg.mywebsite.com

Use the AccessControll Apache module to forbid access to the diferent servers: http://httpd.apache.org/docs/2.2/howto/access.html