1

Let me describe the problem I need to solve:

There is a sandbox server (Debian), each developer has own user account on it. I need to provide an easy and quick way of running/stopping any number of nginx instances on different ports for different projects. These will be used only by QA for testing purposes.

For example:
Alice runs a server on sandbox.example.com:4001 that points to folder /home/alice/web/staging_2014_09_24

Bob runs three servers:
sandbox.example.com:5123 -> /home/bob/www/dev_2014_09_24_login_fix sandbox.example.com:5124 -> /home/bob/www/staging_2014_09_20 sandbox.example.com:5126 -> /home/bob/www/testing_release_features

Each of these folders would contain some branch of PHP code from Git.

Questions:
1. Is there an easy, common way to do this? The solution I now think about is writing a script, which would create a parameterized config for nginx and then run a new server instance using it. It could be executed like: ./serverManager start www/staging_2014_09_20 5124 or ./serverManager stop 5124
2. Do I also need to spawn new php-fpm process for every server or I can use one common instance?

3
  • 1
    You do realise that since those nginx instances don't listen to privileged network ports, they don't have to be started by root. Bob and Alice can (in theory) start their own instances if you configure each instance to not need access to root owned directories...
    – HBruijn
    Sep 24, 2014 at 15:07
  • I know this. But the question is how to start and manage them really quickly - it's the task each developer will have to do daily and I don't think that editing nginx.conf file manually for every host is a best idea.
    – Aldekein
    Sep 24, 2014 at 15:39
  • Docker? You could even automate that, having Jenkins start them. Sep 24, 2014 at 16:18

0

You must log in to answer this question.

Browse other questions tagged .