1

My current configuration is:

Apache2 + MPM-Worker AND FastCGI + PHP5-fpm (PHP 5.3.2) ON Ubuntu 10.04 LTS

I have a single pool of 2-5 processes running as a different user from that of the default www-data. FastCGI/PHP5-fpm is configured as an external server via FastCGIExternalServer

I know that I can setup multiple pools running as different users ...

But, I want to know if it is possible to use suEXEC in this type of setup? And, could it be setup with just a single pool? If so, how?

farinspace
  • 173
  • 1
  • 1
  • 13

2 Answers2

1

As of now, It is not possible to run a script as anything other than the user defined in the FPM pool.

You would need to setup a different pool and define the other user/group.

Is there some reason you can't or don't want to create separate pools?

EDIT: If you are worried about wasting idle resources, there is some talk about creating an "ondemand" feature for fpm-pools, that would essentially "fire up" the pool when it gets requests: http://groups.google.com/group/highload-php-en/browse_thread/thread/753ddceff2ef0411/8ebaddeec4f676f0?lnk=gst&q=idle+pool#8ebaddeec4f676f0

I highly recommend the highload-en php google group "...for discussing php, FastCGI, php-fpm and all technologies around for use in high loaded environments." http://groups.google.com/group/highload-php-en?lnk=srg

iainlbc
  • 2,694
  • 19
  • 19
1

I think this is what you are looking for. BTW you don't need php-fpm with mod_fastcgi

And answer to your question is NO. You can't use your pool because it's already running and is running with certain user rights that couldn't be changed within FPM (by design). Just use approach I pointed to. Good luck

Dmytro Leonenko
  • 456
  • 1
  • 7
  • 24
  • I think its worthy noting that php-fpm matures the mod_fastcgi implementation and is now included with PHP (for good reason). By not using FPM you are loosing out on quite a few improvements & bug fixes. The particular implementation you referenced is from 2005... That being said they are both tools in the toolbox, OP should use whichever best suits his needs...people are using both implementations in production with success. – iainlbc Mar 21 '11 at 21:27
  • But when you apache and it's suEXEC doesn't now nothing about FPM. You have to create pool for each user on your own. Then you don't need suEXEC at all. I think taht farinspace asks for single pool not only because of memory overhead or performance. – Dmytro Leonenko Mar 22 '11 at 08:50
  • I am trying to avoid the extra use of memory with many pools running at once. Is it possible to run the same php-cgi/suEXEC setup, but with php-fpm by tweaking the "[daemonize](http://php-fpm.org/wiki/Configuration_File)" config? – farinspace Mar 24 '11 at 16:03
  • 1
    @farinspace I think you should post this to the highload-en php group as this is a pretty specialized question. I have not heard of anyone doing it yet and I follow the fpm community pretty closely. Pretty sure you're gonna need to drop FPM if you want the functionality you describe. Why fit a square peg into a round hole anyways...its going be a headache when you need to update – iainlbc Mar 24 '11 at 18:30