Source of template.plp
  1. <(template.plp)>
  2. <: BEGIN { $title = 'Install'; } :>
  3. <: title "Installing PLP in 9 easy steps." :>

  4. <: item 'Prerequisites' :>
  5. Make sure you have Perl 5.6 or newer, and that you have an 1.3 version of Apache (tested with 1.3.12 and 1.3.24).

  6. <: item 'Deciding on mod_perl versus CGI' :>
  7. All default Apache installations allow for CGI to be used. However, CGI is very inefficient
  8. because a new process has to be started for every script execution. With mod_perl, you have
  9. a resident Perl interpreter built into Apache, which allows for speeds up to six times as fast
  10. as with CGI.<BR>
  11. mod_perl is not hard to install, as you can read in Stas Bekman's quick start guide "<a href="">mod_perl in 30 minutes</a>". As always, Debian users are lucky people: packages are available (read <a href="/debianmodperl.txt">these instructions</a>).<BR><BR>

  12. <: item 'Downloading and installing the PLP modules' :>
  13. Get the distribution from the <a href="/files/">files directory</a> of this site, and follow the
  14. usual installation procedures:
  15. <: code Entity "tar -zvxf PLP-versionnumber.tar.gz\ncd PLP-versionnumber\nperl Makefile.PL\nmake\nmake install"; :>
  16. Once again, Debian users are blessed with a package, which is also downloadable from the <a href=
  17. "/files/">files directory</a>.
  18. <: code Entity "dpkg -i libplp-perl_versionnumber-1_all.deb" :>

  19. <: item 'PLP with mod_perl' :>
  20. Installation with mod_perl is easy, just put these lines in your httpd.conf:
  21. <: code Entity "<Files *.plp>\n  SetHandler perl-script\n  PerlHandler PLP\n  PerlSendHeader On\n  PerlSetVar PLPcache On\n</Files>" :>
  22. And restart Apache.

  23. <: item 'PLP with CGI' :>
  24. First, create a directory for PLP. I'll use /foo/bar in examples, but something like /usr/local/lib/plp might be handier.
  25. In that directory, we put plp.cgi that is in the distribution (if you didn't use the tar.gz, you can find the script using "man PLP". Don't be alarmed, it's only three lines), and we make it executable.
  26. <: code Entity "mkdir -p /foo/bar\ncd /foo/bar\ncp ~/PLP-versionnumber/plp.cgi .\nchmod 755 plp.cgi" :>
  27. Then, we add a bunch of configuration to httpd.conf:
  28. <: code Entity
  29. qq{ScriptAlias /foo/bar/ /PLP_COMMON/
  30. <Directory /foo/bar/>
  31.   AllowOverride None
  32.   Options +ExecCGI
  33.   Order allow,deny
  34.   Allow from all
  35. </Directory>
  36. AddHandler plp-document plp
  37. Action plp-document /PLP_COMMON/plp.cgi}
  38. :>
  39. Restart Apache to make it use the new settings.

  40. <: item 'Testing the PLP installation' :>
  41. We test by creating a simple test.plp file in our website directory.
  42. <: code Entity qq{<html><body>\n<: print "It works!<BR>" for 1..10 :\>\n</body></html>} :>
  43. If that prints "It works!" ten times, you're set to go. If not, examing your error log
  44. for details (search for error_log or error.log if you don't know where to find it).