From: Erik <eri...@bo...> - 2004-12-22 10:06:15
|
l=F6r 2004-10-09 klockan 15:10 +0200 skrev Boris Zentner: > Hi, > from time to time I think on a version of PageKit that works with CGI=20 > and LWP instead of mod_perl, has anybody a opinion on such a module? It=20 > may work where mod_perl is not avail or when another persistent module=20 > is used like mod_cgi or pperl or whatever. Also CGI::PageKit could=20 > serve pages without Apache. I thought of it as a dropin replacement for=20 > pagekit, just that you get a CGI object instead of apr. Currently this=20 > is only a idea to waste some time. What do you think? >=20 It would be nice to have FCGI::Pagekit. Pagekit in a FCGI environment. It would give the benefits of persistent Pagekit (as in mod_perl) and the benefits of a standalone app that one can slowly immigrate to. When you already have large site it is quite hard to immigrate to Pagekit due to the fact that so match code need to be converted and often there are no time to convert the hole site at once. But small parts can be converted at time to time.=20 I'm actually at braking point where I need the Pagekit in FastCGI environment or at least part of PageKit. Pagekit in a only-CGI environment would be to slow. But then if Pagekit exist in a CGI environment its a Small thing to convert it to a FCGI-environment. Its already multi-usage-safe (due to mod_perl). We have converted several CGI to FastCGI by just adding a loop and remove exit from the code. Like this: my $request =3D FCGI::Request(); my $unload_file =3D '.unload'; my $mtime =3D (stat $unload_file)[9]; while($request->Accept() >=3D 0) { eval { main_body(); }; warn $@ if($@); } continue { exit if (stat $unload_file)[9] > $mtime; } sub main_body { #old CGI-code } =20 The .unload file are for restarting the FastCGI progs by just touching it (touch .unload). And in Apache we only have a FastCGI handler for .fcgi. So we can have two copies (.fcgi and .cgi) of the prog one that are handle by FastCGI and one that are normal CGI (slower of cause, but good for development). --=20 /erikg=20 =20 Erik G=FCnther eri...@bo... System Developer Bokus AB +46 (0)40 - 35 21 19 icq: 160744619 = =20 =20 Fortune: <taniwha> Zoid: we're nuts, but we're productive nuts:) * taniwha wonders what productive nuts taste like |