Making a (relatively) secure dynamic PHP test environment with nginx
I’ve been working on a deployment tool for WordPress development environments; one that can quickly provision and maintain the dizzying array of sites needed to test plugins against different versions of WordPress (with and w/o Multisite). BuddyPress authentic discount canada goose hybridge jacket mens . bbPress discount canada goose hybridge jacket mens . etc.
Some cocktail napkin math suggested at least 20 combinations were needed to cover all the currently-supported configurations. Besides the chore of setting up environments for each. the need to add or remove environments as components are updated makes a manual deployment effort seem ridiculous.
While I’m finishing up work on that tool discount canada goose hybridge jacket mens for sale . I thought I’d start by posting the web server and PHP configs I’m using to make this happen.
I went with nginx because of its low memory usage and its handy regular-expression hostname matching, canada goose factory ontario for sale . which I find more flexible and less kludgey for this application than mod_vhost_alias or mod_rewrite. This nginx config will provide the flexibility of dynamically-creating sites while still providing some isolation between them.
server server_name ~^(.*)\.dev discount canada goose hybridge jacket mens .your.domain$ ; set $instance $1; set $session_root /var/www/dev/$instance/sessions; root /var/www/dev/$instance/html; index index.php; location ~ \ where to buy discount canada goose hybridge jacket mens .php$ try_files $uri =404; fastcgi_split_path_info ^( discount canada goose hybridge jacket mens , real canada goose london store uk .+\.php)(/ discount canada goose hybridge jacket mens sales , cheap canada goose trillium parka outlet online .+)$; fastcgi_pass unix./var/run/fpm-devsites canada goose fur fluffy outlet online .sock; # fastcgi_pass 127.0.0 ou trouver un manteau canada goose parka outlet online .1.9000 fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root\nsession.save_path=$session_root"; include /etc/nginx/fastcgi_params; location / try_files $uri $uri/ /index.php;
Thanks to mike at http. //michaelshadle. com/2011/02/11/setting-php-ini-parameters-from-nginx for the great guide to the PHP_ADMIN_VALUE param canada goose mens chateau parka 2015 .
Ideally each site would have its own FPM pool. but that would mean root privileges were needed to provision new sites canada goose bomber jacket youth store online . So a single but separate pool for the dev environments was a necessary compromise. The goal of dynamically creating sites through an un discount canada goose hybridge jacket mens .
- discount canada goose hybridge jacket mens
- canada goose bomber jacket youth store online
- canada goose mens chateau parka 2015
- ou trouver un manteau canada goose parka outlet online
- canada goose fur fluffy outlet online
- canada goose chateau spirit online store
- canada goose jacket washington online store
- canada goose victoria l