Top Level Apache Server, Port 80, ModProxyThis allowed me to have seperate modperl instances, this is done for three reasons:This serves requests via ModProxy to the respective apache servers with mod_perl.Site 1 Apache Server, Port 8081, ModPerlThis server runs an instance of ModPerl and all scripts required for Site 1.Site 2 Apache Server, Port 8082, ModPerl
Apache User: site1This server runs an instance of ModPerl and all scripts required for Site 2.
Apache User: site2
1) ModPerl does not support user based processesThe problem with this configuration is:
2) This prevents polution between instances & secures one mod_perl instance from another.
3) Each instance can be chrooted for additional security.
1) Requires a new http server for each additional site/modperl application---------------------------------
2) Apache creates a set of workers for each instance (ususally about 7). With 7 required for the Top level proxy, and 7 for each site, this soon adds up.e.g. 5 sites = 7 + (5 * 7) = 49 child workers
1. Create a Chroot Jail for Apache (Extra Security Measure). 2. Modify suExec to allow chrooting before suid and process execution.How it works:
3. Install Apache into Chroot Jail
4. For each site:
a. Create a Jail for each site that includes perl + speedycgi
b. Create a virtualhost which specifies SuExecUserGroup and the ENV variable used for the chroot.
Apache first resides in a jail, it then serves non-perl requests to static objects as per normal. When a request for a perl script is made:Advantages:Apache chroots into the site's jail using suexec. Suexec changes to the correct site's user.
SpeedyCGI then either:
Loads a script into speedy-backend or
Executes a script cached in speedy-backend
1) Provides persistant perl WITH suexec for per-virtualhost user executionDisadvantages:
2) SpeedyCGI handles dynamic data, Apache handles static, hence you don't require a covering proxy as described in http://perl.apache.org/docs/1.0/guide/strategy.html
3) The timeout property in speedycgi means that a script with low or no load will drop out of memory, this means high use scripts will run in persistant perl and low use scripts will load into memory then remove themself when they are no longer being activly used.
1) Speedycgi seems to be no longer in development, whereas modperl is still in active development.---------------------------------
2) I have read somewhere that speedycgi is not as fast as modperl (will have to benchmark the two later).
3) Since speedycgi with timeout enabled fades out with inactivity, the first request to an inactive script requires all the modules to be reloaded, whereas modperl exists in memory indefinitly and can load a script on server start, rather than first request.
In reply to Apache (httpd) + Persistant Perl (ModPerl/SpeedyCGI) + User Based Processes (SuExec) + Chroot by zxViperxz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |