You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by st...@apache.org on 2002/05/10 09:47:40 UTC

cvs commit: modperl-docs/src/docs/1.0/guide method_handlers.pod Changes.pod config.cfg getwet.pod help.pod advocacy.pod browserbugs.pod control.pod correct_headers.pod download.pod hardware.pod multiuser.pod perl.pod start.pod

stas        02/05/10 00:47:40

  Modified:    src/docs/1.0/guide Changes.pod config.cfg getwet.pod
                        help.pod
  Added:       src/docs/1.0/guide method_handlers.pod
  Removed:     src/docs/1.0/guide advocacy.pod browserbugs.pod control.pod
                        correct_headers.pod download.pod hardware.pod
                        multiuser.pod perl.pod start.pod
  Log:
  mod_perl version independent docs have moved to general::
  
  Revision  Changes    Path
  1.19      +4 -0      modperl-docs/src/docs/1.0/guide/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/1.0/guide/Changes.pod,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Changes.pod	9 May 2002 10:37:36 -0000	1.18
  +++ Changes.pod	10 May 2002 07:47:40 -0000	1.19
  @@ -11,6 +11,10 @@
   
   =head1 ??? ver 1.32
   
  +* guide::method_handlers
  +
  +  o moved here from the faqs
  +
   * guide::databases
   
      o correct the notes regarding "Opening Connections With Different
  
  
  
  1.5       +3 -15     modperl-docs/src/docs/1.0/guide/config.cfg
  
  Index: config.cfg
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/1.0/guide/config.cfg,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- config.cfg	20 Apr 2002 06:36:02 -0000	1.4
  +++ config.cfg	10 May 2002 07:47:40 -0000	1.5
  @@ -2,7 +2,7 @@
   @c = (
       id => 'guide',
   
  -    title => "mod_perl guide",
  +    title => "mod_perl 1.x User Guide",
   
       abstract => <<EOB,
   Deploying mod_perl technology to give rocket speed to your CGI/Perl scripts.
  @@ -12,30 +12,21 @@
       chapters => [qw(
           getwet.pod
           intro.pod
  -        start.pod
           install.pod
           config.pod
       )],
   
       group    => 'Coding',
       chapters => [qw(
  -        perl.pod
           porting.pod
  -        correct_headers.pod
  +        method_handlers.pod
           databases.pod
           dbm.pod
  +        security.pod
           snippets.pod
           modules.pod
       )],
   
  -    group    => 'Maintenance',
  -    chapters => [qw(
  -        control.pod
  -        multiuser.pod
  -        hardware.pod
  -        security.pod
  -    )],
  -
       group    => 'Advanced Setup and Performance',
       chapters => [qw(
           strategy.pod
  @@ -48,14 +39,11 @@
           frequent.pod
           troubleshooting.pod
           debug.pod
  -        browserbugs.pod
           help.pod
       )],
   
       group    => 'Miscellaneous',
       chapters => [qw(
  -        advocacy.pod
  -        download.pod
           Changes.pod
       )],
   
  
  
  
  1.4       +26 -26    modperl-docs/src/docs/1.0/guide/getwet.pod
  
  Index: getwet.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/1.0/guide/getwet.pod,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- getwet.pod	26 Apr 2002 18:08:48 -0000	1.3
  +++ getwet.pod	10 May 2002 07:47:40 -0000	1.4
  @@ -50,9 +50,9 @@
   distributions will have installed Perl by default. To check that the
   tools are available and learn about their version numbers, try:
   
  -  panic% make -v
  -  panic% gcc -v
  -  panic% perl -v
  +  % make -v
  +  % gcc -v
  +  % perl -v
   
   If any of these responds with C<Command not found>, it will need to be
   installed.
  @@ -76,14 +76,14 @@
   I</home/stas/src/>, proceed with the described steps and you will have
   mod_perl installed:
   
  -  panic% cd /home/stas/src
  -  panic% tar -zvxf apache_x.x.x.tar.gz
  -  panic% tar -zvxf mod_perl-x.xx.tar.gz
  -  panic% cd mod_perl-x.xx
  -  panic% perl Makefile.PL APACHE_SRC=../apache_x.x.x/src \
  +  % cd /home/stas/src
  +  % tar -zvxf apache_x.x.x.tar.gz
  +  % tar -zvxf mod_perl-x.xx.tar.gz
  +  % cd mod_perl-x.xx
  +  % perl Makefile.PL APACHE_SRC=../apache_x.x.x/src \
         APACHE_PREFIX=/home/httpd DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
  -  panic% make && make test
  -  panic% su
  +  % make && make test
  +  % su
     panic# make install
   
   That's all!
  @@ -134,19 +134,19 @@
   
   The next step is to move to the directory with the source files:
   
  -  panic% cd /home/stas/src
  +  % cd /home/stas/src
   
   Uncompress and untar both sources.  GNU I<tar> allows this using a
   single command per file:
   
  -  panic% tar -zvxf apache_x.x.x.tar.gz
  -  panic% tar -zvxf mod_perl-x.xx.tar.gz
  +  % tar -zvxf apache_x.x.x.tar.gz
  +  % tar -zvxf mod_perl-x.xx.tar.gz
   
   For non-GNU I<tar>'s, you may need to do this with two steps (which
   you can combine via a pipe):
   
  -  panic% gzip -dc apache_x.x.x.tar.gz | tar -xvf -
  -  panic% gzip -dc mod_perl-x.xx.tar.gz | tar -xvf -
  +  % gzip -dc apache_x.x.x.tar.gz | tar -xvf -
  +  % gzip -dc mod_perl-x.xx.tar.gz | tar -xvf -
   
   Linux distributions supply C<tar> and C<gzip> and install them by
   default; for other systems these utilities should be obtained from
  @@ -159,13 +159,13 @@
   Move into the I</home/stas/src/mod_perl-x.xx/> source distribution
   directory:
   
  -  panic% cd mod_perl-x.xx
  +  % cd mod_perl-x.xx
   
   The next step is to create the I<Makefile>. This step is no different
   in principle from the creation of the I<Makefile> for any other Perl
   module.
   
  -  panic% perl Makefile.PL APACHE_SRC=../apache_x.x.x/src \
  +  % perl Makefile.PL APACHE_SRC=../apache_x.x.x/src \
       DO_HTTPD=1 USE_APACI=1 EVERYTHING=1
   
   (Replace I<x.x.x> with the Apache distribution version number.)
  @@ -186,7 +186,7 @@
   module is that all the missing modules will be installed with the
   C<Bundle::Apache> bundle:
   
  -  panic% perl -MCPAN -e 'install("Bundle::Apache")'
  +  % perl -MCPAN -e 'install("Bundle::Apache")'
   
   We will talk about using C<CPAN.pm> in-depth in the L<installation
   process chapter|guide::install>.
  @@ -201,7 +201,7 @@
   utility. (Note that the current working directory is still
   I</home/stas/src/mod_perl-x.xx/>):
   
  -  panic% make
  +  % make
   
   This command prepares the mod_perl extension files, installs them in
   the Apache source tree and builds the I<httpd> executable (the web
  @@ -212,7 +212,7 @@
   Running C<make test> will execute various mod_perl tests on the
   freshly built I<httpd> executable.
   
  -  panic% make test
  +  % make test
   
   This command starts the server on a non-standard port (8529) and tests
   whether all parts of the built server function correctly. The process
  @@ -227,7 +227,7 @@
   be used if the appropriate options were set on the C<perl Makefile.PL>
   command line.  To become I<root>, use the I<su> command.
   
  -  panic% su
  +  % su
     panic# make install
   
   If you have the proper permission, you might also chain all three
  @@ -472,7 +472,7 @@
   
   First create this directory if it doesn't yet exist.
   
  -  panic% mkdir /home/stas/modperl
  +  % mkdir /home/stas/modperl
   
   What about file permissions?  Remember that when scripts are executed
   from a shell, they are being executed with permissions of the user's
  @@ -488,7 +488,7 @@
   the permissions on all files and directories should usually be
   C<rwx------>, so we can set the directory permissions to:
   
  -  panic% chmod 0700 /home/stas/modperl
  +  % chmod 0700 /home/stas/modperl
   
   Now, no-one, but you and the server can access the files in this
   directory. You should set the same permissions for all the files you
  @@ -552,7 +552,7 @@
   The I<mod_perl_rules1.pl> script can be tested from the command line,
   since it is essentially a regular Perl script.
   
  -  panic% perl /home/stas/modperl/mod_perl_rules1.pl
  +  % perl /home/stas/modperl/mod_perl_rules1.pl
   
   This should produce the following output:
   
  @@ -708,7 +708,7 @@
   code from the above examples.  To find out what the C<@INC>
   directories are, execute:
   
  -  panic% perl -le 'print join "\n", @INC'
  +  % perl -le 'print join "\n", @INC'
   
   On our machine it reports:
   
  @@ -838,7 +838,7 @@
   new scripts may need to be added, old ones removed, and the server
   software will need upgrades and security fixes. And if the server goes
   down, fast recovery is essential. These issues are considered in
  -the L<Controlling your server chapter|guide::control>.
  +the L<Controlling your server chapter|docs::general::control>.
   
   Finally, the most important aspect of mod_perl is the Apache Perl API,
   which allows intervention at any or every stage of request
  
  
  
  1.16      +18 -437   modperl-docs/src/docs/1.0/guide/help.pod
  
  Index: help.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/1.0/guide/help.pod,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- help.pod	27 Apr 2002 03:19:40 -0000	1.15
  +++ help.pod	10 May 2002 07:47:40 -0000	1.16
  @@ -1,6 +1,6 @@
   =head1 NAME
   
  -Getting Help and Further Learning
  +Getting Help
   
   =head1 Description
   
  @@ -8,13 +8,15 @@
   for information on how to get help on mod_perl, Apache, or other topics
   discussed here.
   
  -
   =head1 READ ME FIRST
   
  -If, after reading this guide and the other documents listed in this
  -section, you still don't have the answers/information needed, please
  -ask for help on the Apache/mod_perl mailing list.  But please, first 
  -try to browse the mailing list archive.  Most of the time you will 
  +If, after reading this guide and the L<other documents|docs::general::offsite>
  +listed on this
  +site, you still don't have the answers/information needed, please
  +ask for help on the L<mod_perl users mailing list|maillist::list-modperl>.
  +But please, first try to browse the
  +L<mailing list archive|maillist::list-modperl/Searchable_Archives>.
  +Most of the time you will 
   find the answer to your questions by searching the archive, since it is 
   very likely that someone else has already encountered the same problem
   and found a solution for it.  If you ignore this advice, you should not
  @@ -24,8 +26,7 @@
   help and you should I<RTFM> before you call for I<HELP>.  (Remember the
   fable of the shepherd boy and the wolves).
   
  -For more information See L<Get help with
  -mod_perl|guide::help/Get_help_with_mod_perl>.
  +Another possibilty is to look in the general L<Getting Help|help::index> section of this site for a commercial training or consulting company.
   
   =head1 How to Report Problems
   
  @@ -92,9 +93,9 @@
   
   Here is a summary of how to get a backtrace:
   
  -  panic% cd mod_perl-x.xx
  -  panic% touch t/conf/srm.conf
  -  panic% gdb ../apache_x.xx/src/httpd
  +  % cd mod_perl-x.xx
  +  % touch t/conf/srm.conf
  +  % gdb ../apache_x.xx/src/httpd
     (gdb) run -X -f `pwd`/t/conf/httpd.conf -d `pwd`/t
     [now make request that causes core dump]
     (gdb) bt
  @@ -110,15 +111,15 @@
   Alternatively you can also attach to an already running process like
   so:
   
  -  panic% gdb httpd <process id number>
  +  % gdb httpd <process id number>
   
   If the dump is happening in I<libperl> you have to rebuild Perl with
   C<-DDEBUGGING> enabled. A quick way to this is to go to your Perl
   source tree and run these commands:
   
  -  panic% rm *.[oa]
  -  panic% make LIBPERL=libperld.a
  -  panic% cp libperld.a $Config{archlibexp}/CORE
  +  % rm *.[oa]
  +  % make LIBPERL=libperld.a
  +  % cp libperld.a $Config{archlibexp}/CORE
   
   where C<$Config{archlibexp}> is:
   
  @@ -136,14 +137,14 @@
   
   While the process is spinning, send it a I<USR1> signal:
   
  -  panic% kill -USR1 <process id number>
  +  % kill -USR1 <process id number>
   
   and the Perl stack trace will be printed.
   
   alternatively you can use gdb to find which Perl code is causing the
   spin:
   
  -  panic% gdb httpd <pid of spinning process>
  +  % gdb httpd <pid of spinning process>
     (gdb) where
     (gdb) source mod_perl-x.xx/.gdbinit
     (gdb) curinfo
  @@ -155,426 +156,6 @@
   =back
   
   Finally send all these details to the modperl mailing list.
  -
  -=head1 Get help with mod_perl
  -
  -=over
  -
  -=item * mod_perl home
  -
  -http://perl.apache.org
  -
  -=item * News and Resources
  -
  -Take23: News and Resources for the mod_perl world 
  -http://take23.org
  -
  -=item * mod_perl Books
  -
  -=over
  -
  -=item * Writing Apache Modules with Perl and C
  -
  -http://www.modperl.com is the home site of The Apache Modules Book, a book
  -about creating Web server modules using the Apache API, written by
  -Lincoln Stein and Doug MacEachern.
  -
  -The book should be available from your local bookstore or from your
  -favorite on-line bookseller.  O'Reilly lists this book as:
  -
  -  Writing Apache Modules with Perl and C
  -  By Lincoln Stein & Doug MacEachern
  -  1st Edition March 1999
  -  2nd Edition Feb 2000
  -  1-56592-567-X, Order Number: 567X
  -  746 pages, $34.95
  -
  -=item * The mod_perl Developer's Cookbook
  -
  -Home site: http://www.modperlcookbook.org
  -
  -SAMS lists this book as:
  -
  -  The mod_perl Developer's Cookbook
  -  By Geoffrey Young; Paul Lindner; Randy Kobes
  -  ISBN: 0672322404
  -  Pub. Date: Jan 17,2002
  -  Price: $39.99
  -  Pages: 600
  -
  -=item * Practical mod_perl
  -
  -http://www.modperlbook.com is the home site of the new mod_perl book,
  -that Eric Cholet and Stas Bekman are co-authoring.  We expect
  -the book to be published in 2002.
  -
  -Ideas, suggestions and comments are welcome. Please send them to
  -info@modperlbook.com .
  -
  -=item * mod_perl Quick Reference Card
  -
  -I<mod_perl Pocket Reference> by Andrew Ford was published by O'Reilly
  -and Associates http://www.oreilly.com/catalog/modperlpr/
  -
  -You should probably get also the I<Apache Pocket Reference> by the
  -same author and the same publisher:
  -http://www.oreilly.com/catalog/apachepr/
  -
  -See also Andrew's collection of reference card for Apache and other
  -programs: http://www.refcards.com.
  -
  -=back
  -
  -=item * 
  -
  -L<mod_perl Guide|docs::1.0::guide::index> by Stas Bekman.
  -
  -=item * mod_perl FAQ
  -
  -by Frank Cringle at http://perl.apache.org/faq/ .
  -
  -=item * mod_perl performance tuning guide 
  -
  -by Vivek Khera at http://perl.apache.org/tuning/ .
  -
  -=item * mod_perl plugin reference guide 
  -
  -by Doug MacEachern at http://perl.apache.org/src/mod_perl.html .
  -
  -=item * Quick guide for moving from CGI to mod_perl
  -
  -at http://perl.apache.org/dist/cgi_to_mod_perl.html .
  -
  -=item * mod_perl_traps, common traps and solutions for mod_perl users
  -
  -at http://perl.apache.org/dist/mod_perl_traps.html .
  -
  -=item * Articles
  -
  -=over
  -
  -=item * ApacheToday
  -
  -http://apachetoday.com
  -
  -=item * Basic knowledge about Apache stages and mod_perl handlers
  -article in German
  -
  -http://www.heise.de/ix/artikel/2000/01/156/
  -
  -=back
  -
  -=item * L<mod_perl mailing lists|maillist::index>.
  -
  -=back
  -
  -=head1 Get help with Perl
  -
  -=over
  -
  -=item * The Perl FAQ
  -
  -http://www.perl.com/CPAN/doc/FAQs/FAQ/PerlFAQ.html
  -
  -=item * The Perl Home Page
  -
  -http://www.perl.com/
  -
  -=item * The Perl Journal
  -
  -http://www.tpj.com/
  -
  -=item * Perl Module Mechanics
  -
  -http://world.std.com/~swmcd/steven/perl/module_mechanics.html - This
  -page describes the mechanics of creating, compiling, releasing and
  -maintaining Perl modules.
  -
  -=item * Creating (and Maintaining) Perl Modules
  -
  -http://www.mathforum.com/~ken/perl_modules.html
  -
  -=item * XS tutorials
  -
  -Perl manpages: I<perlguts>, I<perlxs>, and I<perlxstut> manpages.
  -
  -Dean Roehrich's XS CookBookA and CookBookB
  -http://search.cpan.org/search?dist=CookBookA
  -http://search.cpan.org/search?dist=CookBookB
  -
  -a series of articles by Steven McDougall:
  -http://world.std.com/~swmcd/steven/perl/pm/xs/intro/index.html
  -http://world.std.com/~swmcd/steven/perl/pm/xs/concepts.html
  -http://world.std.com/~swmcd/steven/perl/pm/xs/tools/index.html
  -http://world.std.com/~swmcd/steven/perl/pm/xs/modules/modules.html
  -http://world.std.com/~swmcd/steven/perl/pm/xs/nw/NW.html
  -
  -I<Advanced Perl Programming> By Sriram Srinivasan. Published by
  -O'Reilly & Associates. ISBN: 1-56592-220-4. Chapters 18-20.
  -http://www.oreilly.com/catalog/advperl/
  -
  -perl-xs mailing list on perl.org (mail perl-xs-subscribe@perl.org)
  -
  -Take a look also at Inline.pm (CPAN) and SWIG (http://www.swig.org/)
  -
  -=item * Perl mailing lists
  -
  -A huge number of diverse Perl mailing lists is listed at
  -http://lists.perl.org/.
  -
  -=item * perl5-porters mailing list
  -
  -Send an email:
  -
  -=over
  -
  -=item * 
  -
  -to perl5-porters-subscribe@perl.org to subscribe to this list.
  -
  -=item * 
  -
  -to perl5-porters-unsubscribe@perl.org to unsubscribe to this list.
  -
  -=item * 
  -
  -to perl5-porters-digest-subscribe@perl.org if you prefer a digest
  -version.
  -
  -=item * 
  -
  -to perl5-porters-digest-unsubscribe@perl.org to unsubscribe from the
  -digest.
  -
  -=item * 
  -
  -to perl5-porters-help@perl.org for more information about the
  -subscription options.
  -
  -=back
  -
  -List's archive is available at
  -http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/.
  -
  -=back
  -
  -=head1 Get help with Perl/CGI
  -
  -=over
  -
  -=item * Perl/CGI FAQ
  -
  -at http://www.perl.com/CPAN/doc/FAQs/cgi/perl-cgi-faq.html
  -
  -=item * Answers to some troublesome Perl and Perl/CGI questions
  -
  -http://stason.org/TULARC/webmaster/myfaq.html
  -
  -=item * Idiot's Guide to CGI programming
  -
  -http://www.webdeveloper.com/cgi-perl/cgi_idiots_guide_to_perl.html
  -
  -=item * WWW Security FAQ
  -
  -http://www.w3.org/Security/Faq/www-security-faq.html
  -
  -=item * CGI/Perl Taint Mode FAQ
  -
  -http://www.gunther.web66.com/FAQS/taintmode.html (by Gunther
  -Birznieks)
  -
  -=item * cgi-list mailing list
  -
  -Send email to majordomo@jann.com with body:
  -
  -  subscribe cgi-list
  -
  -=back
  -
  -=head1 Get help with Apache 
  -
  -=over
  -
  -=item * Apache Project's Home
  -
  -http://www.apache.org
  -
  -=item * Apache Mailing Lists
  -
  -You will find a comprehensive list of all Apache projects' mailing
  -lists at: http://www.apache.org/foundation/mailinglists.html
  -
  -=item * Apache Quick Reference Card
  -
  -http://www.refcards.com (other reference cards are also available 
  -from this link)
  -
  -=item * The Apache FAQ
  -
  -http://www.apache.org/docs/misc/FAQ.html
  -
  -=item * Apache Server Documentation
  -
  -http://www.apache.org/docs/
  -
  -=item * Apache Handlers
  -
  -http://www.apache.org/docs/handler.html
  -
  -=item * mod_rewrite Guide
  -
  -http://www.engelschall.com/pw/apache/rewriteguide/
  -
  -=item * Security:
  -
  -Security and Apache: An Essential Primer
  -http://linuxplanet.com/linuxplanet/print/1527/
  -
  -Using Apache with Suexec on Linux
  -http://linuxplanet.com/linuxplanet/print/1445/
  -
  -How to 'chroot' an Apache tree with Linux and Solaris
  -http://penguin.epfl.ch/chroot.html
  -
  -Installing and Securing the Apache Webserver with SSL
  -http://online.securityfocus.com/infocus/1356
  -
  -How to break out of a chroot() jail:
  -http://www.bpfh.net/simes/computing/chroot-break.html
  -
  -Jails: Confining the omnipotent root:
  -http://docs.freebsd.org/44doc/papers/jail/jail.html
  -
  -FreeBSD Developers' Handbook: The Jail Subsystem
  -http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/jail.html
  -
  -=item * mod_throttle_access
  -
  -mod_throttle_access is available at http://www.fremen.org/apache/
  -
  -=back
  -
  -=head1 Get help with DBI and SQL
  -
  -=over
  -
  -=item *
  -
  -Introduction to Structured Query Language:
  -http://www.dbbm.fiocruz.br/class/Lecture/d17/sql/jhoffman/sqltut.html
  -
  -=item *
  -
  -SQL for Web Nerds by Philip Greenspun
  -http://www.arsdigita.com/books/sql/
  -
  -=item * Jeffrey Baker's DBI Examples and Performance Tuning
  -
  -http://www.saturn5.com/~jwb/dbi-examples.html (by Jeffrey William
  -Baker).
  -
  -=item * DBI Homepage
  -
  -http://www.symbolstone.org/technology/perl/DBI/
  -
  -=item * DBI mailing list information
  -
  -http://www.fugue.com/dbi/ 
  -
  -=item * DBI mailing list archives
  -
  -http://www.bitmechanic.com/mail-archives/dbi-users/
  -http://www.xray.mpe.mpg.de/mailing-lists/dbi/
  -
  -=back
  -
  -=head1 Get help with Squid - Internet Object Cache
  -
  -=over 4
  -
  -=item *
  -
  -Home page - http://squid.nlanr.net/
  -
  -=item *
  -
  -FAQ - http://squid.nlanr.net/Squid/FAQ/FAQ.html
  -
  -=item *
  -
  -Users Guide - http://squid.nlanr.net/Squid/Users-Guide/
  -
  -=item *
  -
  -Mailing lists - http://squid.nlanr.net/Squid/mailing-lists.html
  -
  -=back
  -
  -=head1 Get help with CVS -- Concurrent Version Control
  -
  -=over
  -
  -=item *
  -
  -The mod_perl cvs repository specific L<document|faqs::mod_perl_cvs>.
  -
  -=item *
  -
  -Open Source Development with CVS
  -http://cvsbook.red-bean.com/
  -
  -=item *
  -
  -Online Documents
  -http://www.cvshome.org/docs/
  -
  -=item *
  -
  -CVS Quick Reference Card
  -http://www.refcards.com/about/cvs.html
  -
  -=back
  -
  -=head1 Get help with Performance and Scalability
  -
  -=over
  -
  -=item * Techniques and Technologies for Scaling Internet Services mailing list.
  -
  -The list's address: scalable@arctic.org.
  -Subscribe by sending a message to scalable-subscribe@arctic.org.
  -Archive: http://archive.develooper.com/scalable@arctic.org/
  -
  -=item *
  -
  -I<Solaris 2.x - Tuning Your TCP/IP Stack and More>
  -http://www.sean.de/Solaris/tune.html
  -
  -This page talks about TCP/IP stack and various tricks of tuning your
  -system to get the most out of it as a web server. While the
  -information is for Solaris 2.x OS, most of it will be relevant of
  -other Unix flavors. At the end an extensive list of related literature
  -is presented.
  -
  -=item *
  -
  -High-Availability Linux Project
  -http://www.linux-ha.org/
  -
  -=back
  -
  -=head1 Get help with Unix OS flavors -- Unix OS related resources
  -
  -=over
  -
  -=item * Memory system management and architecture:
  -
  -The Solaris memory system, sizing, tools and architecture:
  -http://www.sun.com/sun-on-net/performance/vmsizing.pdf
  -
  -=item * 
  -
  -=back
   
   =head1 Maintainers
   
  
  
  
  1.1                  modperl-docs/src/docs/1.0/guide/method_handlers.pod
  
  Index: method_handlers.pod
  ===================================================================
  =head1 NAME 
  
  How to use mod_perl's MethodHandlers 
  
  =head1 Description
  
  Described here are a few examples and hints how to use MethodHandlers
  with mod_perl.
  
  This document assumes familiarity with at least the I<perltoot>
  manpage and "normal" usage of the C<Perl*Handlers>.
  
  It isn't strictly mod_perl related, more like "what I use objects for
  in my mod_perl environment".
  
  =head1 Synopsis
  
  If a B<Perl*Handler> is prototyped with 'C<$$>', this handler will be
  invoked as method, being passed a class name or blessed object as its
  first argument and the blessed I<request_rec> as the second argument,
  e.g.
  
   package My;
   @ISA = qw(BaseClass);
   
   sub handler ($$) {
       my($class, $r) = @_;
       ...;
   }
   
   package BaseClass;
   
   sub method ($$) {
       my($class, $r) = @_;
       ...;
   }
   
   __END__
  
  
  Configuration:
  
   PerlHandler My
  
  or
  
   PerlHandler My->handler
  
  Since the handler is invoked as a method, it may inherit from other
  classes:
  
   PerlHandler My->method
  
  In this case, the 'C<My>' class inherits this method from 'C<BaseClass>'.
  
  To build in this feature, configure with:
  
   % perl Makefile.PL PERL_METHOD_HANDLERS=1 [PERL_FOO_HOOK=1,etc]
  
  =head1 Why?
  
  The short version: For pretty much the same reasons we're using OO
  perl everywhere else. :-) See the I<perltoot> manpage.
  
  The slightly longer version would include some about code reusage and
  more clean interface between modules.
  
  =head1 Simple example
  
  Let's start with a simple example.
  
  In httpd.conf:
  
   <Location /obj-handler>
   SetHandler perl-script
   PerlHandler $My::Obj->method
   </Location>
  
  In startup.pl or another PerlRequire'd file:
  
   package This::Class;
  
   $My::Obj = bless {};
  
   sub method ($$) {
       my($obj, $r) = @_;
       $r->send_http_header("text/plain");
       print "$obj isa ", ref($obj);
       0;
   }
  
  which displays:
  
   This::Class=HASH(0x8411edc) isa This::Class
  
  =head1 A little more advanced
  
  That wasn't really useful, so let's try something little more advanced.
  
  I've a little module which creates a graphical 'datebar' for a client.
  It's reading a lot of small gifs with numbers and weekdays, and keeping
  them in memory in GD.pm's native format, ready to be copied together and
  served as gifs.
  
  Now I wanted to use it at another site too, but with a different
  look. Obviously something to do with a object. Hence I changed the
  module to a object, and can now do a 
  
   $Client1::Datebar = new Datebar(
  	 -imagepath => '/home/client1/datebar/',
  	 -size      => [131,18],
  	 -elements  => 'wday mday mon year hour min',
   );
  
   $Client2::Datebar = new Datebar
  	 -imagepath => '/home/client2/datebar/',
  	 -size      => [90,14],
  	 -elements  => 'wday hour min',
   );
  
  And then use C<$Client1::Datebar> and C<$Client2::Datebar> as PerlHandlers in my
  Apache configuration. Remember to pass them in literal quotes ('') and not
  "" which will be interpolated!
  
  I've a webinterface system to our content-database. I've created
  objects to handle the administration of articles, banners, images and
  other content.  It's then very easy (a few lines of code) to enable
  certain modules for each client, depending on their needs.
  
  Another area where I use objects with great success in my modperl
  configurations is database abstraction.  All our clients using the
  webinterface to handle f.x. articles will use a simple module to
  handle everything related to the database.  Each client have
  
   $Client::Article = new WebAjour::Article(-host => 'www.client.com');
  
  in a module what will be run at server startup.
  
  I can then use some simple methods from the $Client::Article object in
  my embperl documents, like:
  
   [- $c = $Client::Article->GetCursor(-layout=>'Frontpage') -]
   [$ while($c->Fetch) $]
     <h2>[+ $c->f('header') +]</h2>
     [+ $c->f('textfield') +]
   [$ endwhile $]
  
  Very very useful!
  
  =head1 Traps
  
  mod_perl expects object handlers to be in the form of a string, which it
  will thaw for you. That means that something like 
  
   $r->push_handlers(PerlHandler => '$self->perl_handler_method');
  
  This doesn't work as you might expect, since Perl isn't able to see
  $self once it goes to PerlHandler. 
  
  The best solution to this is to use an anonymous subroutine and pass it $r
  yourself, like this:
  
   $r->push_handlers(PerlHandler => 
       sub {
           my $r = shift;
           $self->perl_handler_method($r);
       }
   );
  
  =head1 Author
  
  This document is written by Ask Bjoern Hansen E<lt>ask@netcetera.dkE<gt> or
  E<lt>ask@apache.orgE<gt>.  Corrections and suggestions are most
  welcome. In particular would more examples be appreciated, most of my
  own code is way too integrated with our system, which isn't suitable
  for public release.
  
  Some codesnippets is from Doug MacEachern.
  
  =head1 See Also
  
  The I<Apache>, the I<perltoot> manpages (also
  available at C<http://www.perl.com/CPAN/doc/FMTEYEWTK/perltoot.html>)
  
  =head1 Maintainers
  
  Maintainer is the person(s) you should contact with updates,
  corrections and patches.
  
  =over
  
  =item * 
  
  L<modperl docs list|maillist::list-docs-dev>
  
  =back
  
  =head1 Authors
  
  =over
  
  =item *
  
  Ask Bjoern Hansen, E<lt>ask (at) netcetera.dkE<gt> or E<lt>ask (at)
  apache.orgE<gt>.
  
  =back
  
  Only the major authors are listed above. For contributors see the
  Changes file.
  
  
  =cut
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org