Thread: php 5.3 fastcgi
View Single Post
  #6   (View Single Post)  
Old 16th July 2013
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I came across this thread today while searching for something else, and, as often happens, I got interested in it. Fekete, I hope this is useful to you, if you still have open issues with PHP and FastCGI from May.
---

PHP middleware and chroot


--

Last year, I was working with php-fpm and the nginx webserver, in setting up a rather complex infrastructure that was fairly successful, but then was never implemented in production. During testing, I was using chrooted php-fpm. And as I was doing frequent updates to the PHP components, I built a simple script for keeping the chroot structure up to date with PHP middleware. Extremely simple script, as this was just for use in a lab environment.

The php-fpm module is one possible choice of FastCGI implementations, and I chose it due to its "fit" with nginx. I recall that it requires its child processes to be assigned to specific gids and optionally a uid, in pools of process groups. That may, or may not be helpful, as it seems you want to be able to assign FastCGI processes to individual website users, rather than divided process authorization by applet/portlet groups.

Whether or not that background is helpful to you, I thought I'd share my simple script for replicating the entire PHP middleware suite into a chrooted environment.
Code:
#!/bin/sh
cd /var/www
tar cf - `ls -d /etc/php* /usr/local/{lib,bin,sbin}/php*` | tar xpf -
tar cf - `ldd /usr/local/sbin/php* | grep usr | awk '{print $7}'` | tar xpf -
---

SlowCGI

---

You might be interested in slowcgi(8). Added to -current recently, it will be included in the release of OpenBSD 5.4. Here's the background.
Reply With Quote