|LiveJournal on Apache 2
||[Aug. 11th, 2007|06:33 pm]
So, I resurrected my old and dusty changes for running the Livejournal code on Apache 2 (using mod_perl 2 and Apache2::compat), and it looks like they work about as well as they ever did. (I wish I could say the same for the underlying code!) Specifically, they consist of:|
- An extra wrapper module, Apache::LJWrapper, for a few things that're different in an incompatible way between mod_perl 1 and mod_perl 2 and that Apache2::compat either doesn't fix or breaks compatibility with mod_perl 2 if asked to fix.
- A script to modify the code so that it uses the wrapper where necessary
- A few one-off changes to deal with non-backwards-compatible stuff in mod_perl 2
The code is still very poorly tested, but seems to work. It should also be backwards compatible with Apache 1.3, but that's totally untested (it used to work, though). You can find it here. Check out Livejournal from svn as usual, apply each patch to the appropriate directory under cvs and run do-codereplace.sh, then continue as you would normally. There are a few small changes to httpd.conf: use PerlConfigRequire instead of PerlRequire, add a "PerlOptions +GlobalRequest" somewhere before this, and note that "PerlSetEnv LJHOME /home/lj" may not work within a VirtualHost directive. Also, don't even think about using this code on a production system.
Edit: Two other things. Firstly, the Livejournal code is not threadsafe. Secondly, IPC::Open2 doesn't seem to work right, so spellchecking is broken (and leaks zombie processes to boot). Unfortunately, some quick Googling shows that there have been problems with IPC::Open2 snd mod_perl for years. brad put a work-around in back in 2002, but I've no idea what it does and it obviously doesn't help in mod_perl 2.