[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Fastcgi or apache-mpm-itk?



On Tue, Jun 03, 2008 at 05:08:09PM +0200, Paul van der Vlis wrote:

> I would like to install Apache for shared hosting. I would like also
> a form of secure PHP.

> I like to use Debian packages for security-support. There are no
> packages for mpm-peruser and mod-ruid so I don't want them.  Suphp
> and php5-cgi are slow, I've heard.

> What would you choose?

I use Apache as a reverse proxy front-end and a backend of lighttpd
(with mod_extforward activated) executing the PHP code; I run the PHP
just as CGIs (no speed needs), but lighttpd supports the FastCGI
interface, so you can use that to save the fork/exec overhead. Each
user has his own backend running under his UID (actually, a dedicated
UID different from his that he can sudo to or with group memberships
and filessytem ACLs setup so that things work); possibly that won't
scale enough for you.

This solution sometimes requires fixing the PHP code to use the right
hostname in self-referencing links; some PHP apps look at the wrong
place and construct backend URLs instead of front-end URLs. (I don't
remember out of the top of my head, but it is something like
SERVER_NAME vs HTTP_HOST.) Many apps use the wrong source, but have a
setting that overrides their wrong detection statically; it is often
easier to set this rather than fix the wrong detection logic.

-- 
Lionel


Reply to: