You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by sb...@hyperreal.org on 1998/12/03 22:04:28 UTC

cvs commit: modperl-site/guide config.html control.html debug.html help.html index.html intro.html obvious.html performance.html porting.html scenario.html snippets.html start.html status.html warnings.html

sbekman     98/12/03 13:04:28

  Modified:    guide    config.html control.html debug.html help.html
                        index.html intro.html obvious.html performance.html
                        porting.html scenario.html snippets.html start.html
                        status.html warnings.html
  Log:
  Initial release (the previous was an old one :)
  
  Revision  Changes    Path
  1.2       +233 -47   modperl-site/guide/config.html
  
  Index: config.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/config.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- config.html	1998/12/03 20:51:06	1.1
  +++ config.html	1998/12/03 21:04:21	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: mod_perl Configuration </TITLE>
  +   <TITLE>mod_perl guide: Server Configuration</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,13 +12,36 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -mod_perl Configuration </H1>
  +Server Configuration</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
   <UL>
   
   	<LI><A HREF="#configuration">configuration</A>
  +	<UL>
  +
  +		<LI><A HREF="#aliases_configurations">aliases configurations</A>
  +	</UL>
  +
  +	<LI><A HREF="#Configuration_of_Location">Configuration of Location</A>
  +	<UL>
  +
  +		<LI><A HREF="#perl_status_location">perl-status location </A>
  +		<LI><A HREF="#perl_startup_file">perl-startup file</A>
  +		<LI><A HREF="#PerlFreshRestart">PerlFreshRestart</A>
  +		<LI><A HREF="#What_modules_should_you_add_to_t">What modules should you add to the startup file and why.</A>
  +		<LI><A HREF="#Is_it_possible_to_preopen_a_DB_c">Is it possible to preopen a DB connection at the server startup?</A>
  +		<LI><A HREF="#Perl_behavior_controls">Perl behavior controls</A>
  +	</UL>
  +
  +	<LI><A HREF="#Perl_Sections">Perl Sections</A>
  +	<LI><A HREF="#General_pitfalls">General pitfalls</A>
  +	<UL>
  +
  +		<LI><A HREF="#My_cgi_perl_code_is_being_return">My cgi/perl code is being returned as a plain text instead of being executed by the webserver?</A>
  +	</UL>
  +
   </UL>
   <!-- INDEX END -->
   
  @@ -26,24 +49,76 @@
   <P>
   <CENTER><H1><A NAME="configuration">configuration</A></H1></CENTER>
   <P>
  -<PRE>  After installation of the apache with mod_perl you have to change apache's
  -  config files, to make it work.
  -  
  -  Add to these files:
  -  
  -  httpd.conf (at the bottom):
  -  _________________________________________________________________
  -  
  -  # startup.perl loads all functions that we want to use within mod_perl
  -  Perlrequire  /path/to/startup.pl
  -  
  -  # To reload PerlRequire's, PerlModule's, other use()'d modules and flush 
  -  # the Apache::Registry cache, enable with this command: 
  -  PerlFreshRestart On  
  -  
  -  # mod_perl
  -  # mod_perl scripts root location
  -  &lt;Location /perl&gt;
  +You have just installed the new apache/mod_perl server. Now you have to
  +configure server's configuration files. To learn how to configure the
  +apache's config files, please the use the apache's documentation or just
  +open the files in conf directory and follow the instructions in these files
  +- they are selfexplainable...
  +
  +<P>
  +Before you start configuration of mod_perl, configure the apache, and see
  +that it works. When done, come back to continue...
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="aliases_configurations">aliases configurations</A></H2></CENTER>
  +<P>
  +OK, first thing you will want to specify the location from where all
  +mod_perl scripts will be called.
  +
  +<P>
  +in srm.conf add:
  +
  +<P>
  +<PRE>    # plain cgi-bin:
  +  ScriptAlias /cgi-bin/ /usr/apps/myproject/cgi-bin
  +    
  +    # Apache::Registry mode
  +  ScriptAlias /perl/ /usr/apps/myproject/cgi/
  +</PRE>
  +<P>
  +<PRE>    # Apache::PerlRun mode
  +  ScriptAlias /cgi-perl/ /usr/apps/myproject/cgi/
  +</PRE>
  +<P>
  +Alias allows the server to locate the script that was called at the
  +filesystem.
  +
  +<P>
  +Alias is the start of the URL path to the script you call, like when you
  +fetch <A
  +HREF="http://www.you.com/perl/test.pl">http://www.you.com/perl/test.pl</A>
  +, server will look for the file test.pl at /usr/apps/myproject/cgi but
  +execute it as a Apache::Registry script, after you set this (see the next
  +section). <A
  +HREF="http://www.you.com/perl/test.pl">http://www.you.com/perl/test.pl</A>
  +will be mapped to /usr/apps/myproject/cgi-bin/test.pl . Basically you can
  +have all your cgis located at the same place at filesystem, and to call the
  +same script in any of 3 modes by just replacing the first directory of the
  +URL (cgi-bin|perl|cgi-perl) - Isn't that cool? If something is going wrong
  +with your mod_perl you can easily call the scripts in the mod_cgi mode
  +without changing the script (in most cases) but only the URL to call it,
  +and then to put it back!!!
  +
  +<P>
  +Ofcourse you can choose any other alias (you will use it later in
  +http.conf), you can choose to use all 3 modes or only one of these (It's
  +unlikely to run plain cgi-bin scripts from mod_perl server - the price is
  +too high, you better run these at plain apache server. See
  +<A HREF="././scenario.html#Making_a_strategic_decision">Real World scenario</A> for details)
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H1><A NAME="Configuration_of_Location">Configuration of Location</A></H1></CENTER>
  +<P>
  +Now we work with httpd.conf, I add all the mod_perl stuff at the end of
  +file, after the native apache configurations finish.
  +
  +<P>
  +First we add:
  +
  +<P>
  +<PRE>  &lt;Location /perl&gt;
       #AllowOverride None
       SetHandler perl-script
       PerlHandler Apache::Registry
  @@ -51,41 +126,93 @@
       allow from all
       PerlSendHeader On
     &lt;/Location&gt;
  -    
  -  
  -  #&amp;nbsp;Status location (shows different mod_perl statuses)
  -  &lt;Location /perl-status&gt;
  +</PRE>
  +<P>
  +This location's configuration makes all scripts that has been called with
  +/perl path at the beginning to be executed under
  +<STRONG>Apache::Registry</STRONG> module and as cgi (so the <CODE>ExecCGI</CODE>, if you omit this option the script will be just printed to the caller's
  +browser as a plain text or will trigger the 'Save-As' window). 
  +
  +<P>
  +<CODE>PerlSendHeader On</CODE> tells the server to send an HTTP header to the browser, on every script
  +envocation. You will want to turn it off for you nph (non-parsed-headers)
  +scripts.
  +
  +<P>
  +Remember the Alias from the section above? We must use the same Alias here,
  +if you use Location that doesn't have the same Alias defined in srm.conf,
  +the server will fail to locate the script at the filesystem. I'm talking
  +about scripts execution (There are cases where Location is something that's
  +being executed by the server itself, without having the corresponding file,
  +like <A HREF="#perl_status">perl-status</A>)
  +
  +<P>
  +Note that sometimes you will have to to add : PerlModule Apache::Registry
  +
  +<P>
  +before you specify the location that uses Apache::Registry as a
  +PerlHandler. Basically you can start running the scripts in the
  +Apache::Registry mode...
  +
  +<P>
  +You have to do nothing about /cgi-bin (mod_cgi), since it has nothing to do
  +with mod_perl
  +
  +<P>
  +A similar location configuration for Apache::PerlRun. (More about
  +<A HREF="././porting.html#Apache_PerlRun_a_closer_look">Apache::PerlRun</A>)
  +
  +<P>
  +<PRE>  &lt;Location /cgi-perl&gt;
  +    #AllowOverride None
       SetHandler perl-script
  -    PerlHandler Apache::Status
  -    order deny,allow
  -    #deny from all
  -    #allow from 
  +    PerlHandler Apache::PerlRun
  +    Options ExecCGI
  +    allow from all
  +    PerlSendHeader On
     &lt;/Location&gt;
  -  
  -  _________________________________________________________________
  -  
  -  Perlrequire startup.pl pulls
  -  up all the modules we want to use with mod_perl and want them to be preloaded.
  -  
  -  startup.pl:
  -  _____________________________________________________
  -  
  -  use strict;
  +</PRE>
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="perl_status_location">perl-status location</A></H2></CENTER>
  +<P>
  +/perl-status location allows you to see many things about your server. See
  +/<A HREF="././status.html#Configuration">perl-status</A>
  +
  +
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="perl_startup_file">perl-startup file</A></H2></CENTER>
  +<P>
  +Since many times you have to add many perl directives to the config file,
  +it can be a good idea to put all of these into one file, so the config file
  +will be cleaner, also you can call <CODE>perl -c perl-startup</CODE>
  +to test the file's syntax. What is takes? Add this line to httpd.conf:
  +
  +<P>
  +<PRE>    # startup.perl loads all functions that we want to use within mod_perl
  +  Perlrequire  /path/to/startup.pl
  +</PRE>
  +<P>
  +An example of perl-startup file:
  +
  +<P>
  +<PRE>  use strict;
     
     #modify @INC if needed
     use lib qw(/some/other/dir /some/bar/dir);
     
     # make sure we are in a sane environment.
  -  $ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die &amp;quot;GATEWAY_INTERFACE not Perl!&amp;quot;;
  +  $ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die &quot;GATEWAY_INTERFACE not Perl!&quot;;
      
  -  # for things in the &amp;quot;/perl&amp;quot; URL
  +  # for things in the &quot;/perl&quot; URL
     use Apache::Registry;          
      
     #load perl modules of your choice here
     #this code is interpreted *once* when the server starts
  -  #use CGI::Switch ();
  -  #use LWP::UserAgent ();
  -  #use DBI ();
  +  use LWP::UserAgent ();
  +  use DBI ();
     
     # tell me more about warnings
     use Carp ();
  @@ -95,10 +222,50 @@
     use CGI ();
     CGI-&gt;compile(':all');
     
  -  
  -=head1 Perl Sections
   </PRE>
   <P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="PerlFreshRestart">PerlFreshRestart</A></H2></CENTER>
  +<P>
  +To reload <CODE>PerlRequire</CODE>, <CODE>PerlModule</CODE>, other <CODE>use()'d</CODE> modules and flush the Apache::Registry cache
  +on server restart, add:
  +
  +<P>
  +<PRE>  PerlFreshRestart On  
  +</PRE>
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="What_modules_should_you_add_to_t">What modules should you add to the startup file and why.</A></H2></CENTER>
  +<P>
  +Modules that are being loaded at the server startup will be shared among
  +server childs, so only one copy of each module will be loaded, thus saving
  +a lot of RAM for you. 
  +
  +<P>
  +See <A HREF="././performance.html#Preload_Perl_modules_at_server_s">Preload Perl modules at server startup</A> 
  +
  + 
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="Is_it_possible_to_preopen_a_DB_c">Is it possible to preopen a DB connection at the server startup?</A></H2></CENTER>
  +<P>
  +Yes! See <A HREF="././performance.html#Persistent_DB_Connections">Persistent DB Connections</A>
  +
  +
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="Perl_behavior_controls">Perl behavior controls</A></H2></CENTER>
  +<P>
  +For <CODE>PerlWarn</CODE> and <CODE>PerlTaintCheck</CODE> see <A HREF="././porting.html#Switches_w_T">Switches -w, -T</A>
  +
  +
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H1><A NAME="Perl_Sections">Perl Sections</A></H1></CENTER>
  +<P>
   With &lt;Perl&gt;&lt;/Perl&gt; sections, it is possible to configure your
   server entirely in Perl.  
   
  @@ -180,6 +347,25 @@
   <P>
   To configure this feature build with 'perl Makefile.PL PERL_SECTIONS=1'  
   
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H1><A NAME="General_pitfalls">General pitfalls</A></H1></CENTER>
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="My_cgi_perl_code_is_being_return">My cgi/perl code is being returned as a plain text instead of being executed by the webserver?</A></H2></CENTER>
  +<P>
  +Check your config files and make sure that the ``ExecCGI'' is turned on in
  +your configurations. 
  +
  +<P>
  +<PRE>  &lt;Location /perl&gt;
  +    SetHandler perl-script
  +    PerlHandler Apache::Registry
  +    Options ExecCGI
  +    allow from all
  +    PerlSendHeader On
  +  &lt;/Location&gt;
  +</PRE>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <P><A HREF="index.html">[Back to the main page]</A></P>
   
  @@ -194,13 +380,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/18/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +183 -6    modperl-site/guide/control.html
  
  Index: control.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/control.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- control.html	1998/12/03 20:51:06	1.1
  +++ control.html	1998/12/03 21:04:21	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Controlling and Monitoring the Server </TITLE>
  +   <TITLE>mod_perl guide: Server Controlling and Monitoring</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,7 +12,7 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Controlling and Monitoring the Server </H1>
  +Server Controlling and Monitoring</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
  @@ -21,6 +21,7 @@
   	<LI><A HREF="#Restarting_techniques">Restarting techniques</A>
   	<LI><A HREF="#How_restart_influences_the_mod_p">How restart influences the mod_perl namespace</A>
   	<LI><A HREF="#Using_apachectl_to_control_the_s">Using apachectl to control the server</A>
  +	<LI><A HREF="#Monitoring_the_Server_A_watchdo">Monitoring the Server. A watchdog.</A>
   	<LI><A HREF="#Single_Mode_Running">Single Mode Running</A>
   	<LI><A HREF="#Starting_a_personal_server_for_e">Starting a personal server for each developer</A>
   	<LI><A HREF="#Wrapper_to_emulate_the_server_en">Wrapper to emulate the server environment</A>
  @@ -86,7 +87,7 @@
   immediately. 
   
   <P>
  -META: What's the difference between USR1 and HUP?
  +META: What's the exact difference between USR1 and HUP?
   
   </DL>
   <P>
  @@ -156,6 +157,182 @@
   
   <P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H1><A NAME="Monitoring_the_Server_A_watchdo">Monitoring the Server. A watchdog.</A></H1></CENTER>
  +<P>
  +With mod_perl many things can happen to your server. The worse one is the
  +possibility that the server will die when you will be not around. As with
  +any other critical service you need to run some kind of watchdog.
  +
  +<P>
  +One simple solution is to use a slightly modified apachectl script which I
  +called apache.watchdog and to put it into the crontab to be called every 30
  +minutes or even every minute - if it's so critical to make sure the server
  +will be up all the time.
  +
  +<P>
  +Crontab entry:
  +
  +<P>
  +0,30 * * * * /path/to/the/apache.watchdog &gt;/dev/null 2&gt;&amp;1
  +
  +<P>
  +The script:
  +
  +<P>
  +<PRE>  #!/bin/sh
  +  
  +  # this script is a watchdog to see whether the server is online
  +  # It tries to restart the server if it's down and sends an email alert to admin
  +  
  +  # admin's email
  +  EMAIL=webmaster@somewhere.far
  +  #EMAIL=root@localhost
  +  
  +  # the path to your PID file
  +  PIDFILE=/usr/apps/var/httpd_perl/run/httpd.pid
  +  
  +  # the path to your httpd binary, including options if necessary
  +  HTTPD=/usr/apps/sbin/httpd_perl/httpd_perl
  +    
  +  # check for pidfile
  +  if [ -f $PIDFILE ] ; then
  +    PID=`cat $PIDFILE`
  +</PRE>
  +<P>
  +<PRE>    if kill -0 $PID; then
  +      STATUS=&quot;httpd (pid $PID) running&quot;
  +      RUNNING=1
  +    else
  +      STATUS=&quot;httpd (pid $PID?) not running&quot;
  +      RUNNING=0
  +    fi
  +  else
  +    STATUS=&quot;httpd (no pid file) not running&quot;
  +    RUNNING=0
  +  fi
  +  
  +  if [ $RUNNING -eq 0 ]; then
  +    echo &quot;$0 $ARG: httpd not running, trying to start&quot;
  +    if $HTTPD ; then
  +      echo &quot;$0 $ARG: httpd started&quot;
  +      mail $EMAIL -s &quot;$0 $ARG: httpd started&quot; &lt;/dev/null &gt;&amp; /dev/null
  +    else
  +      echo &quot;$0 $ARG: httpd could not be started&quot;
  +      mail $EMAIL -s &quot;$0 $ARG: httpd could not be started&quot; &lt;/dev/null &gt;&amp; /dev/null
  +    fi
  +  fi
  +</PRE>
  +<P>
  +Another approach, probably even more practical, is to use the Cool LWP perl
  +package , to test the server by trying to fetch some document (script)
  +served by the server. Why is it more practical? Since the while server can
  +be up as a process, it can be stucked and not working (SYN_RECV state -
  +anyone???), So failing to get the document will trigger restrart, and
  +``probably'' the problem will go away. (Just replace <CODE>start</CODE> with <CODE>restart</CODE> in the <CODE>$restart_command</CODE> below.
  +
  +<P>
  +Again we put this script into a crontab to call it every 30 minutes. 
  +
  +<P>
  +<PRE>  #!/usr/local/bin/perl -w
  +  
  +  use strict;
  +  use diagnostics;
  +  use URI::URL;
  +  use LWP::MediaTypes qw(media_suffix);
  +  
  +  my $VERSION = '0.01';
  +  use vars qw($ua $proxy);
  +  
  +  require LWP::UserAgent;
  +  use <A HREF="HTTP::Status">HTTP::Status</A>;
  +  
  +  ###### Config ########
  +  my $test_script_url = &quot;<A HREF="http://www.stas.com:81/perl/test.pl&quot">http://www.stas.com:81/perl/test.pl&quot</A>;;
  +  my $monitor_email = 'root@localhost';
  +  my $restart_command = '/usr/apps/sbin/httpd_perl/apachectl start';
  +  my $mail_program = &quot;/usr/lib/sendmail -t -n&quot;;   
  +  ######################
  +  
  +  $ua  = new LWP::UserAgent;
  +  $ua-&gt;agent(&quot;$0/Stas &quot; . $ua-&gt;agent);
  +  # Uncomment the proxy if you don't use it!
  +  #  $proxy=&quot;<A HREF="http://www-proxy.com&quot">http://www-proxy.com&quot</A>;;
  +  $ua-&gt;proxy('http', $proxy) if $proxy;
  +  
  +  # If returns '1' it's we are alive
  +  exit 1 if checkurl($test_script_url);
  +  
  +  # We have got the problem - the server seems to be down. Try to
  +  # restart it. 
  +  my $status = system $restart_command;
  +  #  print &quot;Status $status\n&quot;;
  +  
  +  my $message = ($status == 0) 
  +   ? &quot;Server was down and sucessfully restarted!&quot; 
  +   : &quot;Server is down. Can't restart.&quot;;
  +</PRE>
  +<P>
  +<PRE>  my $subject = ($status == 0) 
  +    ? &quot;Attention! Webserver restarted&quot;
  +    : &quot;Attention! Webserver is down. can't restart&quot;;
  +</PRE>
  +<P>
  +<PRE>  # email the monitoring person
  +  my $to = $monitor_email;
  +  my $from = $monitor_email;
  +  send_mail($from,$to,$subject,$message);
  +</PRE>
  +<P>
  +<PRE>  # input:  URL to check 
  +  # output: 1 if sucess, o for fail  
  +  #######################  
  +  sub checkurl{
  +    my ($url) = @_;
  +  
  +    # Fetch document 
  +    my $res = $ua-&gt;request(<A HREF="HTTP::Request-&gt">HTTP::Request-&gt</A>;new(GET =&gt; $url));
  +  
  +    # Check the result status
  +    return 1 if is_success($res-&gt;code);
  +  
  +    # failed
  +    return 0;
  +  } #  end of sub checkurl
  +  
  +  # sends email about the problem 
  +  #######################  
  +  sub send_mail{
  +    my($from,$to,$subject,$messagebody) = @_;
  +</PRE>
  +<P>
  +<PRE>    open MAIL, &quot;|$mail_program&quot; or die &quot;Can't open a pipe to a $mail_program :$!\n&quot;;
  +   
  +    print MAIL &lt;&lt;__END_OF_MAIL__;
  +  To: $to
  +  From: $from
  +  Subject: $subject
  +  
  +  $messagebody
  +  
  +  __END_OF_MAIL__
  +  
  +    close MAIL;
  +  } 
  +  
  +</PRE>
  +<P>
  +<PRE>  &lt;META&gt;
  +  Is it possible to make the server do something when it dies? e.g
  +  restart itself :) NO, really when it dies , (killed in inproper way?)
  +  is it possible to trigger some action?
  +</PRE>
  +<P>
  +<PRE>  Ideas?
  +  &lt;/META&gt;
  +</PRE>
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Single_Mode_Running">Single Mode Running</A></H1></CENTER>
   <P>
   Many times while developing a new code, you will want to run the server in
  @@ -164,7 +341,7 @@
    
   
   <P>
  -<PRE>        % /usr/apps/sbin/httpd_perl/httpd_perl -X
  +<PRE>  % /usr/apps/sbin/httpd_perl/httpd_perl -X
   </PRE>
   <P>
   When you execute the above the server will run in the fg (foreground) of
  @@ -442,13 +619,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/19/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +13 -4     modperl-site/guide/debug.html
  
  Index: debug.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/debug.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- debug.html	1998/12/03 20:51:07	1.1
  +++ debug.html	1998/12/03 21:04:21	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Debugging techniques </TITLE>
  +   <TITLE>mod_perl guide: Code Debugging techniques </TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,18 +12,27 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Debugging techniques </H1>
  +Code Debugging techniques </H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
   <UL>
   
  +	<LI><A HREF="#Sometimes_script_works_Sometime">Sometimes script works, Sometimes Not</A>
   	<LI><A HREF="#Debug_Tracing">Debug Tracing</A>
   </UL>
   <!-- INDEX END -->
   
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <P>
  +<CENTER><H1><A NAME="Sometimes_script_works_Sometime">Sometimes script works, Sometimes Not</A></H1></CENTER>
  +<P>
  +See <A HREF="././porting.html#Sometimes_it_works_Sometimes_Not">Sometimes it works Sometimes Not</A>
  +
  +
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Debug_Tracing">Debug Tracing</A></H1></CENTER>
   <P>
   To enable mod_perl debug tracing configure mod_perl with the PERL_TRACE
  @@ -63,13 +72,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/16/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +5 -5      modperl-site/guide/help.html
  
  Index: help.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/help.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- help.html	1998/12/03 20:51:07	1.1
  +++ help.html	1998/12/03 21:04:21	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Help Seek and Futher Learning </TITLE>
  +   <TITLE>mod_perl guide: </TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -11,7 +11,7 @@
   
   
   <H1 ALIGN=CENTER><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Help Seek and Futher Learning </H1>
  +Help. Futher Learning</H1>
   
   
   <P>
  @@ -101,7 +101,7 @@
   <LI>mod_perl mailing list</LI>
   
   
  -<P><B>The Apache/Perl mailing list (modperl@apache.org) is available for
  +<P>The Apache/Perl mailing list (modperl@apache.org) <B>is available for
   mod_perl users and developers to share ideas, solve problems and discuss
   things related to mod_perl and the Apache::* modules.</B> To subscribe
   to this list, send mail to majordomo@apache.org with the string &quot;subscribe
  @@ -205,10 +205,10 @@
   <TR ALIGN=CENTER VALIGN=TOP>
   <TD ALIGN=CENTER VALIGN=CENTER><B><FONT SIZE=-1>Written by <A HREF="mailto:sbekman@iil.intel.com">Stas
   Bekman</A>.<BR>
  -Last Modified at 11/09/1998 </FONT></B></TD>
  +Last Modified at 12/04/1998 </FONT></B></TD>
   
   
  -<TD><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +<TD><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg"  BORDER=0 ALT="Mod Perl Icon" HEIGHT=59 WIDTH=150></A>
   </TD>
   
   
  
  
  
  1.2       +17 -19    modperl-site/guide/index.html
  
  Index: index.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/index.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.html	1998/12/03 20:51:07	1.1
  +++ index.html	1998/12/03 21:04:22	1.2
  @@ -15,6 +15,9 @@
   to your perl cgi-bin scripts.</B></P></CENTER>
   
   
  +<CENTER><P><B>Version 1.00  Dec, 3 1998</B></P></CENTER>
  +
  +
   <P>
   <HR WIDTH="100%"></P>
   
  @@ -23,48 +26,43 @@
   
   
   <UL>
  -<LI><A HREF="intro.html">Introduction, Incentives and Credits.</A></LI>
  +<LI><A HREF="intro.html">Introduction. Incentives. Credits.</A></LI>
   
   
  -<LI><A HREF="start.html">Getting Started with mod_perl.</A></LI>
  +<LI><A HREF="start.html">Getting Started with mod_perl. Overview.</A></LI>
   
   
  -<LI><A HREF="scenario.html">Real World scenario</A> (the rest of the docs
  -are based and explained upon this scenario).</LI>
  +<LI><A HREF="scenario.html">Server Installation. Real World scenario</A></LI>
   
   
   <LI><A HREF="config.html">Server Configuration</A>.</LI>
   
   
  -<LI><A HREF="control.html">Controlling and Monitoring the Server </A>(starting/stopping,
  -modules reloading, killing and etc...).</LI>
  +<LI><A HREF="control.html">Server Controlling and Monitoring</A></LI>
   
   
  -<LI><A HREF="status.html">Seeing the Unseen: Peeking into the Server Inwards</A></LI>
  +<LI><A HREF="porting.html">CGI => mod_perl Porting. mod_perl Coding guidelines.</A></LI>
   
   
  -<LI><A HREF="porting.html">cgi2mod_perl Porting and Coding guidelines.</A></LI>
  +<LI><A HREF="obvious.html">What is obvious for others but not for you</A>.</LI>
   
   
  -<LI><A HREF="obvious.html">What is obvious for others but not for you</A>.</LI>
  +<LI><A HREF="warnings.html">Warnings and Errors: Where and Why.</A>? </LI>
   
   
  -<LI><A HREF="warnings.html">Warnings and Errors you see: Were do they
  -	  come from and How to fix them</A>? </LI>
  +<LI><A HREF="performance.html">Performance. Benchmarks.</A> </LI>
   
   
  -<LI><A HREF="debug.html">Debugging techniques</A></LI>
  +<LI><A HREF="status.html">mod_perl Status. Peeking into the Server's Perl Inwards</A></LI>
   
   
  -<LI><A HREF="snippets.html">Code Snippets</A> (Usefull Code Snippets)</LI>
  +<LI><A HREF="debug.html">Code Debugging techniques</A></LI>
   
   
  -<LI><A HREF="performance.html">Making it even faster.</A> Performance discussion.
  -DB connections and more.(startup with modules preloading , opening DB connections
  -on schild's startup, global variables and more ).</LI>
  +<LI><A HREF="snippets.html">Code Snippets</A></LI>
   
   
  -<LI><A HREF="help.html">Help Seek and Futher Learning</A></LI>
  +<LI><A HREF="help.html">Help. Futher Learning.</A></LI>
   </UL>
   
   
  @@ -78,10 +76,10 @@
   <TR ALIGN=CENTER VALIGN=TOP>
   <TD ALIGN=CENTER VALIGN=CENTER><B><FONT SIZE=-1>Written by <A HREF="mailto:sbekman@iil.intel.com">Stas
   Bekman</A>.<BR>
  -Last Modified at 11/09/1998 </FONT></B></TD>
  +Last Modified at 12/04/1998 </FONT></B></TD>
   
   
  -<TD><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90></A>
  +<TD><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg"  BORDER=0 ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
   </TD>
   
   
  
  
  
  1.2       +9 -5      modperl-site/guide/intro.html
  
  Index: intro.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/intro.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- intro.html	1998/12/03 20:51:07	1.1
  +++ intro.html	1998/12/03 21:04:22	1.2
  @@ -1,15 +1,19 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl mini-guide: Introduction, Incentives and Credits</TITLE>
  +   <TITLE>mod_perl mini-guide: Introduction. Incentives. Credits. </TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
   </HEAD>
   <BODY TEXT="#000000" BGCOLOR="#E0FFFF" LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
   
   
  -<H1 ALIGN=CENTER><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>Introduction,
  -Incentives and Credits</H1>
  +<H1 ALIGN=CENTER><A HREF="http://perl.apache.org">
  +<IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30
  +	  WIDTH=90 ALIGN=LEFT></A>
  +<A HREF="http://perl.apache.org">
  +<IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30
  +	  WIDTH=90 ALIGN=RIGHT></A>Introduction. Incentives. Credits.</H1>
   
   
   <P>
  @@ -214,10 +218,10 @@
   <TR ALIGN=CENTER VALIGN=TOP>
   <TD ALIGN=CENTER VALIGN=CENTER><B><FONT SIZE=-1>Written by <A HREF="mailto:sbekman@iil.intel.com">Stas
   Bekman</A>.<BR>
  -Last Modified at 11/19/1998 </FONT></B></TD>
  +Last Modified at 12/04/1998 </FONT></B></TD>
   
   
  -<TD><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +<TD><A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg"  BORDER=0 ALT="Mod Perl Icon" HEIGHT=59 WIDTH=150></A>
   </TD>
   
   
  
  
  
  1.2       +104 -27   modperl-site/guide/obvious.html
  
  Index: obvious.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/obvious.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- obvious.html	1998/12/03 20:51:07	1.1
  +++ obvious.html	1998/12/03 21:04:22	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: What is obvious for others but not for you </TITLE>
  +   <TITLE>mod_perl guide: What is obvious for others but not for you</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,7 +12,7 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -What is obvious for others but not for you </H1>
  +What is obvious for others but not for you</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
  @@ -74,10 +74,10 @@
   </PRE>
   <P>
   The tone of this message is definite because the code *will* fail if
  -&amp;amp;x is called more than once. NOTE: Subroutines defined inside
  -BEGIN{} and END{} cannot trigger this message, since each BEGIN{} and END{}
  -is known to be called exactly once. (To understand why, read about the
  -closures at perlref or perlfaq 13.12)
  +<CODE>&amp;x</CODE> is called more than once. NOTE: Subroutines defined
  +inside BEGIN{} and END{} cannot trigger this message, since each BEGIN{}
  +and END{} is known to be called exactly once. (To understand why, read
  +about the closures at perlref or perlfaq 13.12)
   
   <P>
   Also, this slightly different code:
  @@ -99,7 +99,7 @@
   </PRE>
   <P>
   This message is less definite because the code can work correctly, if
  -&amp;amp;y is called only from inside &amp;amp;x.
  +<CODE>&amp;y</CODE> is called only from inside &amp;x.
   
   <P>
   (this was partitially extracted from perl5-porters post)
  @@ -120,9 +120,37 @@
   <PRE>  use vars qw($x $a); at the top of you code
   </PRE>
   <P>
  -META: more solutions? (Code inside packages?)
  +Also see the clarification of <CODE>my()</CODE> vs. <CODE>use vars</CODE> - Ken Williams writes:
   
   <P>
  +<PRE>  Yes, there's quite a bit of difference!  With use vars(), you're
  +  making an entry in the symbol table, and you're telling the compiler
  +  that you're going to be referencing that entry without an explicit
  +  package name.
  +</PRE>
  +<P>
  +<PRE>  With my(), NO ENTRY IS PUT IN THE SYMBOL TABLE.  The compiler figures
  +  out _at_ _compile_time_ which my() variables (i.e. lexical variables)
  +  are the same as each other, and once you hit execute time you can't go
  +  looking those variables up in the symbol table.
  +</PRE>
  +<P>
  +And <CODE>my()</CODE> vs. <CODE>local()</CODE> - Randal Schwartz writes:
  +
  +<P>
  +<PRE>  local() creates a temporal-limited package-based scalar, array, hash,
  +  or glob -- when the scope of definition is exited at runtime, the
  +  previous value (if any) is restored.  References to such a variable
  +  are *also* global... only the value changes.  (Aside: that's what
  +  causes variable suicide. :)
  +</PRE>
  +<P>
  +<PRE>  my() creates a lexically-limited non-package-based scalar, array, or
  +  hash -- when the scope of definition is exited at compile-time, the
  +  variable ceases to be accessible.  Any references to such a variable
  +  at runtime turn into unique anonymous variables on each scope exit.
  +</PRE>
  +<P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Reloading_Modules_and_Required_F">Reloading Modules and Required Files</A></H1></CENTER>
   <P>
  @@ -327,36 +355,85 @@
   follows:
   
   <P>
  -<PRE>  &quot;\377&quot; =~ /$pat|^[\377]$/; # guarenteed if meta-characters present
  +<PRE>  &quot;\377&quot; =~ /$pat|^[\377]$/; # guaranteed if meta-characters present
   </PRE>
   <P>
  -<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  -<CENTER><H1><A NAME="Debugging_your_code_in_Single_Se">Debugging your code in Single Server Mode</A></H1></CENTER>
  +Phil. Chu contributed this:
  +
   <P>
  -Running in httpd -X mode. (good only for testing during development phase)
  +It depends on the complexity of the regex you apply this technique to. One
  +common usage where compiled regex is usually more efficient is to ``match
  +any one of a group of patterns'' over and over again.
   
   <P>
  -You want to test your application that it handles correctly the global
  -variables. (The less you have them the better, but sometimes you just have
  -to have a few of them). It's hard to do with multiply servers serving your
  -cgi since each child can has a different value for its global variables.
  -Imagine that you have a <CODE>random()</CODE> sub that returns a random
  -number and you have the following script.
  +Maybe with some helper routine, it's easier to remember. Here is one
  +slightly modified from Jeffery Friedl's example in his book ``Mastering
  +Regex.''. I find it quite useful:
   
   <P>
  -use vars <CODE>qw($num);</CODE> <CODE>$num</CODE> ||=
  -<CODE>random();</CODE> print ++$num;
  +<PRE>  #####################################################
  +  # Build_MatchMany_Function
  +  # -- Input:  list of patterns
  +  # -- Output: A code ref which matches its $_[0]
  +  #            against ANY of the patterns given in the
  +  #            &quot;Input&quot;, efficiently.
  +  #
  +  sub Build_MatchMany_Function {
  +    my @R = @_;
  +    my $expr = join '||', map { &quot;\$_[0] =~ m/\$R[$_]/o&quot; } ( 0..$#R );
  +    my $matchsub = eval &quot;sub { $expr }&quot;;
  +    die &quot;Failed in building regex @R: $@&quot; if $@;
  +    $matchsub;
  +  }
  +</PRE>
  +<P>
  +Example usage:
   
  +<P>
  +<PRE>  @some_browsers = qw(Mozilla Lynx MSIE AmigaVoyager lwp libwww);
  +  $Known_Browser=Build_MatchMany_Function(@some_browsers);
  +</PRE>
  +<P>
  +<PRE>  while (&lt;ACCESS_LOG&gt;) {
  +    # ...
  +    $browser = get_browser_field($_);
  +    if ( ! &amp;$Known_Browser($browser) ) {
  +      print STDERR &quot;Unknown Browser: $browser\n&quot;;
  +    }
  +    # ...
  +  }
  +</PRE>
   <P>
  -Running this script in multiply server environment will result in something
  -like 1,9,4,19 (number per reload). While if you run in httpd -X single
  -server mode you will get 2,3,4,5...
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H1><A NAME="Debugging_your_code_in_Single_Se">Debugging your code in Single Server Mode</A></H1></CENTER>
  +<P>
  +Running in httpd -X mode. (good only for testing during development phase).
   
  +<P>
  +You want to test your application that it handles correctly the global
  +variables (if you have such - The less you have them the better, but
  +sometimes you just can't without them). It's hard to test with multiply
  +servers serving your cgi since each child has a different value for its
  +global variables. Imagine that you have a <CODE>random()</CODE> sub that
  +returns a random number and you have the following script.
  +
  +<P>
  +<PRE>  use vars qw($num);
  +  $num ||= random();
  +  print ++$num;
  +</PRE>
   <P>
  -META: (Is it representing enough?)
  +This script initializes the <CODE>$num</CODE> with random value, then it
  +increments on each request and print it out. Running this script in
  +multiply server environment will result in something like 1,9,4,19 (number
  +per reload), since ``each'' time your script will be served by a different
  +child. (On some OSes parent process assign all the requests to the same
  +child process if all of the childs are idle... AIX...). But if you run in
  +httpd -X single server mode you will get 2,3,4,5... (taken that the
  +<CODE>random()</CODE> returned 1 at the first call)
   
   <P>
  -But don't get too obsessive wuth this mode, since working only in single
  +But don't get too obsessive with this mode, since working only in single
   server mode sometimes hides problems that show up when you switch to
   multiserver mode. Assume the following code:
   
  @@ -410,13 +487,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/19/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +123 -33   modperl-site/guide/performance.html
  
  Index: performance.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/performance.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- performance.html	1998/12/03 20:51:07	1.1
  +++ performance.html	1998/12/03 21:04:23	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Making it even Faster </TITLE>
  +   <TITLE>mod_perl guide: Performance. Benchmarks.</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,19 +12,27 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Making it even Faster </H1>
  +Performance. Benchmarks.</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
   <UL>
   
   	<LI><A HREF="#Preload_Perl_modules_at_server_s">Preload Perl modules at server startup</A>
  +	<LI><A HREF="#Preopen_DB_connection_at_server_">Preopen DB connection at server startup</A>
   	<LI><A HREF="#Preload_Registry_Scripts">Preload Registry Scripts</A>
   	<LI><A HREF="#Avoid_Importing_Functions">Avoid Importing Functions</A>
   	<LI><A HREF="#Reducing_the_Memory_Usage">Reducing the Memory Usage</A>
   	<LI><A HREF="#Limiting_the_size_of_the_process">Limiting the size of the processes</A>
   	<LI><A HREF="#Limiting_the_resources_used_by_h">Limiting the resources used by httpd children</A>
  -	<LI><A HREF="#Benchmarks">Benchmarks </A>
  +	<LI><A HREF="#Benchmarks_Impressing_your_Boss">Benchmarks. Impressing your Boss and Collegues.</A>
  +	<UL>
  +
  +		<LI><A HREF="#Benchmarking_a_Graphic_hits_coun">Benchmarking a Graphic hits counter with Persistant DB Connection</A>
  +		<LI><A HREF="#Benchmarking_scripts_with_execut">Benchmarking scripts with execution times below 1 second :)</A>
  +		<LI><A HREF="#PerlHandler_s_Benchmarking">PerlHandler's Benchmarking</A>
  +	</UL>
  +
   	<LI><A HREF="#Persistent_DB_Connections">Persistent DB Connections</A>
   	<LI><A HREF="#Real_Numbers">Real Numbers</A>
   	<LI><A HREF="#Profiling">Profiling</A>
  @@ -50,6 +58,17 @@
     CGI-&gt;compile(':all');
   </PRE>
   <P>
  +You can also preload the Registry scripts. See <A HREF="#Preload_Registry_Scripts">Preload Registry Scripts</A>.
  +
  +<P>
  +See also: <A HREF="#Real_Numbers">Real Numbers</A>
  +
  +
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H1><A NAME="Preopen_DB_connection_at_server_">Preopen DB connection at server startup</A></H1></CENTER>
  +<P>
   If you use DBI for DB connections, you can preopen a connections to DB for
   each child with Apache::DBI.
   
  @@ -62,19 +81,11 @@
                                                           };
   </PRE>
   <P>
  -See also <A HREF="#DB_Persistant_Connections">DB Persistant Connections</A>
  +See also <A HREF="#Persistent_DB_Connections">Persistant DB Connections</A>
   
   
   
   <P>
  -You can also preload the Registry scripts. See <A HREF="#Preload_Registry_Scripts">Preload Registry Scripts</A>.
  -
  -<P>
  -See also: <A HREF="#Real_Numbers">Real Numbers</A>
  -
  -
  -
  -<P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Preload_Registry_Scripts">Preload Registry Scripts</A></H1></CENTER>
   <P>
  @@ -185,30 +196,86 @@
   
   <P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  -<CENTER><H1><A NAME="Benchmarks">Benchmarks</A></H1></CENTER>
  +<CENTER><H1><A NAME="Benchmarks_Impressing_your_Boss">Benchmarks. Impressing your Boss and Collegues.</A></H1></CENTER>
   <P>
   How much faster is mod_perl that CGI? There are many ways to benchmark the
  -two, see the benchmark/ directory for some examples.  
  +two. See a few examples and numbers below, also checkout the benchmark/
  +directory of mod_perl dist for more examples.
   
   <P>
  -META: complete!
  +If you write a benchmarks from your own for heavy scripts use
  +<CODE>Benchmark</CODE> and for very fast scripts use <CODE>Time::HiRes</CODE> modules.
   
   <P>
  -for heavy scripts use Benchmark for very fast scripts use Time::HiRes
  +There is no need to write a special benchmark, if you want to impress your
  +boss or collegues, just take the heaviest cgi script you have, open 2
  +xterms and call the same script in mod_perl mode in one xterm and in
  +mod_cgi mode in the other. You can use lwp-get from LWP package to emulate
  +the web agent (browser). (benchmark/ directory of mod_perl dist includes
  +such an example)
   
   <P>
  -<PRE>  use Time::HiRes qw(gettimeofday tv_interval);
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="Benchmarking_a_Graphic_hits_coun">Benchmarking a Graphic hits counter with Persistant DB Connection</A></H2></CENTER>
  +<P>
  +Here are the numbers from Michael Parker's mod_perl presentation at Perl
  +Conference (Aug, 98) <A
  +HREF="http://www.realtime.net/~parkerm/perl/conf98/index.htm">http://www.realtime.net/~parkerm/perl/conf98/index.htm</A>
  +. The script is a standard hits counter, but it logs the counts into the
  +mysql relational DataBase:
  +
  +<P>
  +<PRE>    Benchmark: timing 100 iterations of cgi, perl...  [rate 1:28]
  +</PRE>
  +<P>
  +<PRE>    cgi: 56 secs ( 0.33 usr 0.28 sys = 0.61 cpu) 
  +    perl: 2 secs ( 0.31 usr 0.27 sys = 0.58 cpu) 
  +    
  +    Benchmark: timing 1000 iterations of cgi,perl...  [rate 1:21]
  +</PRE>
  +<P>
  +<PRE>    cgi: 567 secs ( 3.27 usr 2.83 sys = 6.10 cpu) 
  +    perl: 26 secs ( 3.11 usr 2.53 sys = 5.64 cpu)      
  +    
  +    Benchmark: timing 10000 iterations of cgi, perl   [rate 1:21]
  +</PRE>
  +<P>
  +<PRE>    cgi: 6494 secs (34.87 usr 26.68 sys = 61.55 cpu) 
  +    perl: 299 secs (32.51 usr 23.98 sys = 56.49 cpu) 
   </PRE>
   <P>
  -<PRE>  my $start_time = [ gettimeofday ];
  +We don't know what server configurations was used for these testing, but I
  +guess the numbers talks for themselves.
  +
  +<P>
  +The source code of the script at <A
  +HREF="http://www.realtime.net/~parkerm/perl/conf98/sld006.htm">http://www.realtime.net/~parkerm/perl/conf98/sld006.htm</A>
  +
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="Benchmarking_scripts_with_execut">Benchmarking scripts with execution times below 1 second :)</A></H2></CENTER>
  +<P>
  +As noted before for very fast scripts you will ahev to use Time::HiRes
  +module, it's usage is similar to the Benchmark's.
  +
  +<P>
  +<PRE>  use Time::HiRes qw(gettimeofday tv_interval);
  +  my $start_time = [ gettimeofday ];
     &amp;sub_that_takes_a_teeny_bit_of_time()
     my $end_time = [ gettimeofday ];
     my $elapsed = tv_interval($start_time,$end_time);
  +  print &quot;the sub took $elapsed secs.&quot;
   </PRE>
   <P>
  -<PRE>  print &quot;the sub took $elapsed secs.&quot;
  -</PRE>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="PerlHandler_s_Benchmarking">PerlHandler's Benchmarking</A></H2></CENTER>
   <P>
  +At <A
  +HREF="http://perl.apache.org/dist/contrib/">http://perl.apache.org/dist/contrib/</A>
  +you will find Apache::Timeit package which does PerlHandler's Benchmarking.
  +
  +<P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Persistent_DB_Connections">Persistent DB Connections</A></H1></CENTER>
   <P>
  @@ -245,11 +312,17 @@
   disconnect method with a NOP.
   
   <P>
  -The usage is simple: httpd.conf ---------- PerlModule Apache::DBI It is
  -important, to load this module before any other ApacheDBI module !
  +The usage is simple:
   
  +<P>
  +<PRE>  httpd.conf
  +  ----------
  +  PerlModule Apache::DBI
  +  
  +It is important, to load this module before any other ApacheDBI module !
  +</PRE>
   <P>
  -<PRE>  ascript.perl
  +<PRE>  a script.perl
     ------------
     use DBI;
     use strict;
  @@ -285,6 +358,12 @@
   see how to write a ping method.
   
   <P>
  +Also some folks at list suggested to change the timeout of the server (they
  +talked specificly about mysql). So starting from 3.22.x you can set a
  +wait_timeout option at mysqld server startup to change the default value,
  +setting it to 24 hours probably will fix the timeout problem.
  +
  +<P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Real_Numbers">Real Numbers</A></H1></CENTER>
   <P>
  @@ -354,12 +433,14 @@
     httpd     86944  0.0  0.0 1688 1800      - A    16:55:30  0:00 httpd
   </PRE>
   <P>
  -after running a script which uses CGI's methods (no imports): USER PID
  -<CODE>%CPU</CODE> <CODE>%MEM</CODE> SZ RSS TTY STAT STIME TIME COMMAND root
  -86872 0.0 0.0 1448 1552 - A 17:02:56 0:00 httpd httpd 187996 0.0 1.0 2808
  -2968 - A 17:02:56 0:00 httpd
  +after running a script which uses CGI's methods (no imports):
   
   <P>
  +<PRE>  USER        PID %CPU %MEM   SZ  RSS    TTY STAT    STIME  TIME COMMAND
  +  root      86872  0.0  0.0 1448 1552      - A    17:02:56  0:00 httpd
  +  httpd    187996  0.0  1.0 2808 2968      - A    17:02:56  0:00 httpd
  +</PRE>
  +<P>
   Observation: child httpd has grown up by 1168K, 100K less then without
   preload - good!
   
  @@ -389,6 +470,9 @@
   
   <P>
   --------------------------------------------------------------------------------
  +
  +
  +<P>
   2. I have tried the second test to find it. I run the script:
   
   <P>
  @@ -443,6 +527,9 @@
   
   <P>
   --------------------------------------------------------------------------------
  +
  +
  +<P>
   3. The third script
   
   <P>
  @@ -538,10 +625,13 @@
   with the profiler enabled:  
   
   <P>
  -% setenv PERL5OPT -d:DProf % httpd -X -d `pwd` &amp; ... make some requests
  -to the server here ... % kill `cat logs/httpd.pid` % unsetenv PERL5OPT %
  -dprofpp
  -
  +<PRE>  % setenv PERL5OPT -d:DProf
  +  % httpd -X -d `pwd` &amp;
  +  ... make some requests to the server here ...
  +  % kill `cat logs/httpd.pid`
  +  % unsetenv PERL5OPT
  +  % dprofpp
  +</PRE>
   <P>
   The Devel::DProf package is a Perl code profiler. This will collect
   information on the execution time of a Perl script and of the subs in that
  @@ -560,13 +650,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/27/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +116 -33   modperl-site/guide/porting.html
  
  Index: porting.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/porting.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- porting.html	1998/12/03 20:51:08	1.1
  +++ porting.html	1998/12/03 21:04:23	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Writing Mod Perl scripts and Porting plain CGIs to it</TITLE>
  +   <TITLE>mod_perl guide: CGI => mod_perl Porting. mod_perl Coding guidelines.</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,7 +12,7 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Writing Mod Perl scripts and Porting plain CGIs to it</H1>
  +CGI => mod_perl Porting. mod_perl Coding guidelines.</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
  @@ -34,7 +34,7 @@
   			<LI><A HREF="#Running_from_shell">Running from shell</A>
   			<LI><A HREF="#I_O_is_different">I/O is different</A>
   			<LI><A HREF="#HTTP_MIME_Headers">HTTP (MIME) Headers</A>
  -			<LI><A HREF="#NPH_SCRIPTS">NPH SCRIPTS </A>
  +			<LI><A HREF="#NPH_Non_Parsed_Headers_scripts">NPH (Non Parsed Headers) scripts </A>
   			<LI><A HREF="#BEGIN_blocks">BEGIN blocks </A>
   			<LI><A HREF="#END_blocks">END blocks </A>
   			<LI><A HREF="#Switches_w_T">Switches -w, -T </A>
  @@ -42,11 +42,13 @@
   
   		<LI><A HREF="#strict_pragma">strict pragma</A>
   		<LI><A HREF="#Turning_warnings_ON">Turning warnings ON</A>
  +		<LI><A HREF="#diagnostics_pragma">diagnostics pragma</A>
   		<LI><A HREF="#Global_Variables">Global Variables</A>
  -		<LI><A HREF="#Code_is_changed_but_script_seem">Code is changed, but script seems to do the same </A>
  +		<LI><A HREF="#Code_has_been_changed_but_seems">Code has been changed, but seems that script uses the old code</A>
   		<LI><A HREF="#Memory_leakages">Memory leakages</A>
   		<LI><A HREF="#Sometimes_it_works_Sometimes_Not">Sometimes it works Sometimes Not (Very important!)</A>
   		<LI><A HREF="#The_Script_is_too_dirty_It_does_">The Script is too dirty,It does the job and I can't afford rewriting it.</A>
  +		<LI><A HREF="#Apache_PerlRun_a_closer_look">Apache::PerlRun - a closer look</A>
   	</UL>
   
   </UL>
  @@ -90,9 +92,10 @@
   <P><LI><STRONG><A NAME="item_Perl">Perl Module Mechanics</A></STRONG>
   <P>
   This page describes the mechanics of creating, compiling, releasing and
  -maintaining Perl modules.
  -(http://world.std.com/~swmcd/steven/perl/module_mechanics.html) 
  +maintaining Perl modules. <A
  +HREF="http://world.std.com/~swmcd/steven/perl/module_mechanics.html">http://world.std.com/~swmcd/steven/perl/module_mechanics.html</A>
   
  +
   <P><LI><STRONG><A NAME="item_Mod">Mod Perl Book</A></STRONG>
   <P>
   (when it will be released) - you can find parts of the book online at <A
  @@ -359,6 +362,12 @@
   no matter if you run the script as cgi or from shell.
   
   <P>
  +<STRONG>Note</STRONG> that if you run the script under Apache::Registry, <STRONG>The Apache
  +function `exit' overrides the Perl core built-in function</STRONG>. While you see the <CODE>exit()</CODE> listed in <CODE>@EXPORT_OK</CODE>
  +of Apache package, Apache::Registry makes something you don't see and
  +imports this function for you.
  +
  +<P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H3><A NAME="Running_from_shell">Running from shell</A></H3></CENTER>
   <P>
  @@ -400,15 +409,16 @@
   
   <P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  -<CENTER><H3><A NAME="NPH_SCRIPTS">NPH SCRIPTS</A></H3></CENTER>
  +<CENTER><H3><A NAME="NPH_Non_Parsed_Headers_scripts">NPH (Non Parsed Headers) scripts</A></H3></CENTER>
   <P>
  -To run a CGI `nph' script under mod_perl, simply add to your code: 
  +To run a Non Parsed Header CGI script under mod_perl, simply add to your
  +code: 
   
   <P>
   <PRE> local $| = 1;
   </PRE>
   <P>
  -If you normally set PerlSendHeader On, add this to your httpd.conf: 
  +And If you normally set PerlSendHeader On, add this to your httpd.conf: 
   
   <P>
   <PRE> &lt;Files */nph-*&gt;
  @@ -558,6 +568,28 @@
   
   <P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="diagnostics_pragma">diagnostics pragma</A></H2></CENTER>
  +<P>
  +Perl compiler pragma to force verbose warning diagnostics. Put at the start
  +of your scripts:
  +
  +<P>
  +<PRE>  use diagnostics;
  +</PRE>
  +<P>
  +This pragma turns on the -w mode, but gives you a much better diagnostics
  +of the errors and warnings. Generally it explains the reason for
  +warnings/errors you get, shows you an example of code, where the same kind
  +of warning is being triggered and tells you the remedy.
  +
  +<P>
  +It's a bad idea to keep it in your production code! Since it'll spit
  +zillions of diagnostics lines into your error_log file. And it'll add
  +significant overhead to the cgi's runtime. (I discovered this by using
  +Devel::DProf!)
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H2><A NAME="Global_Variables">Global Variables</A></H2></CENTER>
   <P>
   It's always a good idea to stay away from global variables when possible.
  @@ -586,7 +618,7 @@
   </PRE>
   <P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  -<CENTER><H2><A NAME="Code_is_changed_but_script_seem">Code is changed, but script seems to do the same</A></H2></CENTER>
  +<CENTER><H2><A NAME="Code_has_been_changed_but_seems">Code has been changed, but seems that script uses the old code</A></H2></CENTER>
   <P>
   Files pulled in via use or require statements are not automatically
   reloaded when changed on disk. See <A HREF="././obvious.html#Reloading_Modules_and_Required_F">Reloading Modules and Required Files</A> for more info.
  @@ -947,35 +979,86 @@
       allow from all
       PerlSendHeader On
     &lt;/Location&gt;
  -  
  -Apache::PerlRun gives you a
  -benefit of preloaded perl and its modules. This module's handler emulates
  -the CGI environment, allowing programmers to write scripts that run
  -under CGI or mod_perl without change.  Unlike Apache::Registry, the
  -Apache::PerlRun handler does not cache the script inside of a
  -subroutine.  Scripts will be &quot;compiled&quot; every request. After the
  -script has run, it's namespace is flushed of all variables and
  -subroutines. Still, you don't have the overhead of perl and its
  -modules load and compilation time! (If your script is light, but uses
  -lots of standard modules - you will almost not see the difference
  -between Apache::PerlRun and Apache::Registry !).
   </PRE>
   <P>
  +See <A HREF="#">Apache::PerlRun - a closer look</A>
  +
  +
  +
  +<P>
  +Another ``bad'', but working method is to set MaxRequestsPerChild to 1,
  +which will force each child to exit after serving only one request, so
  +you'll get the preloaded modules, etc., the script will be compiled each
  +request, then killed off. This isn't good for ``high-traffic'' sites
  +though, as the parent server will need to fork a new child each time one is
  +killed, but you can fiddle with MaxStartServers, MinSpareServers, to make
  +the parent spawn more servers ahead so the killed one will be immediately
  +replaced with the fresh one. Again, probably that's not what you want.
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="Apache_PerlRun_a_closer_look">Apache::PerlRun - a closer look</A></H2></CENTER>
  +<P>
  +Apache::PerlRun gives you a benefit of preloaded perl and its modules. This
  +module's handler emulates the CGI environment, allowing programmers to
  +write scripts that run under CGI or mod_perl without any change. Unlike
  +Apache::Registry, the Apache::PerlRun handler does not cache the script
  +inside of a subroutine. Scripts will be ``compiled'' on each request. After
  +the script has run, it's namespace is flushed of all variables and
  +subroutines. Still, you don't have the overhead of loading the perl and
  +compilation time of the standart modules (If your script is very light, but
  +uses lots of standard modules - you will see no difference between
  +Apache::PerlRun and Apache::Registry !).
  +
  +<P>
   Be aware though, that if you use some packages that use internals variables
   that has circular references, they will be not flushed!!!
   
   <P>
  -META: Complete the above
  +Apache::PerlRun only flushes your script's namespace, which does not
  +include any other required package's namespace. If there's a reference to
  +<CODE>my()</CODE> scoped variable that's keeping it from being DESTROYed
  +after leaving the eval scope (of Apache::PerlRun), that cleanup might not
  +be taken care of until the server is shutdown and
  +<CODE>perl_destruct()</CODE> is run, which always happens after running
  +command line scripts. Consider this example:
   
  +<P>
  +<PRE>  package Foo;
  +  sub new { bless {} }
  +  sub DESTROY {
  +    warn &quot;Foo-&gt;DESTROY\n&quot;;
  +  }
  +</PRE>
  +<P>
  +<PRE>  eval &lt;&lt;'EOF';
  +  package my_script;
  +  my $self = Foo-&gt;new;
  +  #$self-&gt;{circle} = $self;
  +  EOF
  +</PRE>
  +<P>
  +<PRE>  print $@ if $@;
  +  print &quot;Done with script\n&quot;;
  +</PRE>
  +<P>
  +First you'll see:
  +
  +<P>
  +<PRE>  Foo-&gt;DESTROY
  +  Done with script
  +</PRE>
  +<P>
  +Then, uncomment the line where <CODE>$self</CODE> makes a circular
  +reference, and you'll see:
  +
  +<P>
  +<PRE>  Done with script
  +  Foo-&gt;DESTROY
  +</PRE>
   <P>
  -Another bad, but working method is to set MaxRequestsPerChild to 1, which
  -will force each child to exit after server one request, so you'll get the
  -preloaded modules, etc., the script will be compiled each request, then
  -killed off. This isn't good for ``high-traffic'' sites though, as the
  -parent server will need to fork a new child each time one is killed, but
  -you can fiddle with MaxStartServers, MinSpareServers, to make the parent to
  -spawn more servers ahead so the killed one will be immediately replaced
  -with the fresh ones. Again, probably that's not what you want.
  +In this case, under mod_perl you wouldn't see 'Foo-&gt;DESTROY' until the
  +server shutdown, or your module properly took care of things.
   
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <P><A HREF="index.html">[Back to the main page]</A></P>
  @@ -991,13 +1074,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/27/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +7 -6      modperl-site/guide/scenario.html
  
  Index: scenario.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/scenario.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- scenario.html	1998/12/03 20:51:08	1.1
  +++ scenario.html	1998/12/03 21:04:24	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Real World scenario</TITLE>
  +   <TITLE>mod_perl guide: Server Installation. Real World scenario</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,7 +12,7 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Real World scenario</H1>
  +Server Installation. Real World scenario</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
  @@ -243,9 +243,8 @@
   /usr/apps/usr/src/httpd_perl/apache_1.3.2/src/httpd
   
   <P>
  -<PRE>      
   rename the 'httpd' to 'http_perl' 
  -</PRE>
  +
   <P>
   <PRE>      % mv /usr/apps/sbin/httpd_perl/httpd /usr/apps/sbin/httpd_perl/httpd_perl
   </PRE>
  @@ -256,6 +255,8 @@
   <P>
   <PRE>      % perl -p -i -e 's|httpd_perl/httpd|httpd_perl/httpd_perl|' /usr/apps/sbin/httpd_perl/apachectl
   </PRE>
  +<P>
  +Now proceed to <A HREF="././config.html#">Server Configuration</A> section.
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <P><A HREF="index.html">[Back to the main page]</A></P>
   
  @@ -270,13 +271,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/16/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +7 -5      modperl-site/guide/snippets.html
  
  Index: snippets.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/snippets.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- snippets.html	1998/12/03 20:51:08	1.1
  +++ snippets.html	1998/12/03 21:04:24	1.2
  @@ -38,15 +38,17 @@
   <CENTER><H1><A NAME="Sending_MIME_headers">Sending MIME headers</A></H1></CENTER>
   <P>
   By default, mod_perl does not send any headers by itself, however, you may
  -wish to change this: 
  +wish to change this behavior by setting in config file: 
   
   <P>
   <PRE>  PerlSendHeader On   
   </PRE>
   <P>
  -The safest bet is to use CGI.pm's <CODE>print $query-</CODE><CODE>header()&gt;</CODE> method (If you do you don't need the above
  -setting)
  +The safest bet is to use CGI.pm's <CODE>print header();</CODE> method (If you use this, you don't need the above setting)
   
  +<P>
  +Also there is $ENV{PERL_SEND_HEADER} to see if PerlSendHeader is On or Off.
  +
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <P><A HREF="index.html">[Back to the main page]</A></P>
   
  @@ -61,13 +63,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/17/98 
  +	     <BR>Last Modified at 12/02/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +28 -4     modperl-site/guide/start.html
  
  Index: start.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/start.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- start.html	1998/12/03 20:51:08	1.1
  +++ start.html	1998/12/03 21:04:24	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Getting Started with mod_perl</TITLE>
  +   <TITLE>mod_perl guide: Getting Started with mod_perl. Overview.</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,7 +12,7 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Getting Started with mod_perl</H1>
  +Getting Started with mod_perl. Overview.</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
  @@ -41,6 +41,7 @@
   		<LI><A HREF="#Testing_by_calling_the_perl_sta">Testing by calling the /perl-status </A>
   		<LI><A HREF="#Testing_by_telneting_to_the_port">Testing by telneting to the port server's listening to</A>
   		<LI><A HREF="#Run_a_cgi_that_shows_you_your_se">Run a cgi that shows you your server's environment</A>
  +		<LI><A HREF="#with_lwp_request">with lwp-request</A>
   	</UL>
   
   	<LI><A HREF="#Starting_to_use_the_server">Starting to use the server</A>
  @@ -307,6 +308,29 @@
   
   <P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="with_lwp_request">with lwp-request</A></H2></CENTER>
  +<P>
  +Yet another one. Why do I show all these apporoaches? While here they are
  +serving a very simple purpose, they can be helpfull in other situations. 
  +
  +<P>
  +Assuming you have the libwww-perl package installed (LWP), you will need it
  +installed for passing the mod_perl's <CODE>make test</CODE> anyway.
  +
  +<P>
  +<PRE>  % lwp-request -e -d www.site.com
  +</PRE>
  +<P>
  +Will show you all the headers.
  +
  +<P>
  +<PRE>  % lwp-request -e -d www.site.com | egrep '^Server:'
  +</PRE>
  +<P>
  +To see the server's version only.
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Starting_to_use_the_server">Starting to use the server</A></H1></CENTER>
   <P>
   Now you want to writing the cgis. You better start writing it very clean
  @@ -331,13 +355,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 12/01/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +33 -10    modperl-site/guide/status.html
  
  Index: status.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/status.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- status.html	1998/12/03 20:51:08	1.1
  +++ status.html	1998/12/03 21:04:24	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Seeing the Unseen: Peeking into the Server's Inwards </TITLE>
  +   <TITLE>mod_perl guide: mod_perl Status. Peeking into the Server's Perl Inwards</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,13 +12,19 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Seeing the Unseen: Peeking into the Server's Inwards </H1>
  +mod_perl Status. Peeking into the Server's Perl Inwards</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
   <UL>
   
   	<LI><A HREF="#Watching_the_server">Watching the server</A>
  +	<UL>
  +
  +		<LI><A HREF="#Configuration">Configuration</A>
  +		<LI><A HREF="#Usage">Usage</A>
  +	</UL>
  +
   </UL>
   <!-- INDEX END -->
   
  @@ -26,16 +32,30 @@
   <P>
   <CENTER><H1><A NAME="Watching_the_server">Watching the server</A></H1></CENTER>
   <P>
  -Very important feature. You can dynamically watch what happens to the
  -server
  +Very usefull feature. You can watch what happens to the perl parts of the
  +server. Below you will find the instructions of configuration and usage of
  +this feature
   
   <P>
  -Add this to http.conf: &lt;Location /perl-status&gt; SetHandler perl-script
  -PerlHandler Apache::Status order deny,allow #deny from all #allow from
  -&lt;/Location&gt;
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="Configuration">Configuration</A></H2></CENTER>
  +<P>
  +Add this to http.conf:
   
  +<P>
  +<PRE>  &lt;Location /perl-status&gt;
  +    SetHandler perl-script
  +    PerlHandler Apache::Status
  +    order deny,allow
  +    #deny from all
  +    #allow from 
  +  &lt;/Location&gt;
  +</PRE>
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  +<CENTER><H2><A NAME="Usage">Usage</A></H2></CENTER>
   <P>
  -Then fetch <A
  +Assuming that your mod_perl server listens to port 81, fetch <A
   HREF="http://www.myserver.com:81/perl-status">http://www.myserver.com:81/perl-status</A>
   
   
  @@ -44,6 +64,9 @@
     process 187138, running since Thu Nov 19 09:50:33 1998
   </PRE>
   <P>
  +Below all sections should be links:
  +
  +<P>
   <PRE>  Signal Handlers
     Enabled mod_perl Hooks
     PerlRequire'd Files
  @@ -82,13 +105,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/19/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  
  1.2       +40 -20    modperl-site/guide/warnings.html
  
  Index: warnings.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/guide/warnings.html,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- warnings.html	1998/12/03 20:51:08	1.1
  +++ warnings.html	1998/12/03 21:04:24	1.2
  @@ -1,7 +1,7 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
   <HTML>
   <HEAD>
  -   <TITLE>mod_perl guide: Warnings and Errors you see: Were do they come from and How to fix them</TITLE>
  +   <TITLE>mod_perl guide: Warnings and Errors: Where and Why.</TITLE>
      <META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; AIX 4.1) [Netscape]">
      <META NAME="Author" CONTENT="Bekman Stas">
      <META NAME="Description" CONTENT="mod_perl,perl,apache">
  @@ -12,13 +12,14 @@
   <H1 ALIGN=CENTER>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=LEFT></A>
   <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" BORDER=0 HEIGHT=30 WIDTH=90 ALIGN=RIGHT></A>
  -Warnings and Errors you see: Were do they come from and How to fix them</H1>
  +Warnings and Errors: Where and Why.</H1>
   <HR WIDTH="100%">
   	    <!-- INDEX BEGIN -->
   <P><A NAME="toc"></A><B><FONT SIZE=-1>Table of Contents:</FONT></B></P>
   <UL>
   
  -	<LI><A HREF="#Value_of_x_will_not_stay_shared">Value of $x will not stay shared at - line 5 </A>
  +	<LI><A HREF="#A_general_advice">A general advice </A>
  +	<LI><A HREF="#Value_of_x_will_not_stay_shared">Value of $x will not stay shared at - line 5</A>
   	<LI><A HREF="#Value_of_x_may_be_unavailable_a">Value of $x may be unavailable at - line 5.</A>
   	<LI><A HREF="#Constant_subroutine_redefine">Constant subroutine ... redefined</A>
   	<LI><A HREF="#Global_symbol_foo_requires_ex">Global symbol &quot;$foo&quot; requires explicit package name</A>
  @@ -32,6 +33,13 @@
   
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <P>
  +<CENTER><H1><A NAME="A_general_advice">A general advice</A></H1></CENTER>
  +<P>
  +Using the <CODE>use diagnostics;</CODE> generally helps you to determine the source of the problem and how to solve
  +it. See <A HREF="././porting.html#diagnostics_pragma">diagnostics pragma</A> for more info.
  +
  +<P>
  +<P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Value_of_x_will_not_stay_shared">Value of $x will not stay shared at - line 5</A></H1></CENTER>
   <P>
   See <A HREF="././obvious.html#my_scoped_variable_in_the_nest">my() scoped variable in the nested subroutine</A>
  @@ -57,12 +65,17 @@
   modify your scripts.
   
   <P>
  -&lt;META&gt; Someone said: You won't see that warning in this case with
  -5.004_05 or 5.005+. 
  -
  +<PRE>  &lt;META&gt;
  +  Someone said: 
  +  You won't see that warning in this case with 5.004_05 or 5.005+. 
  +</PRE>
   <P>
  -I'm running perl5.00502 and I still get these warnings??? &lt;/META&gt;
  -
  +<PRE>  I'm running perl5.00502 and I still get these warnings???
  +</PRE>
  +<P>
  +<PRE>  Who is right?
  +  &lt;/META&gt;
  +</PRE>
   <P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Global_symbol_foo_requires_ex">Global symbol &quot;$foo&quot; requires explicit package name</A></H1></CENTER>
  @@ -103,12 +116,15 @@
     /lib/perl5/site_perl/5.005/aix/Apache/Constants.pm line 23.
   </PRE>
   <P>
  -The error is simple to fix, you have used <CODE>use strict;</CODE> pragma, so all variables should be defined before you use them. The bad
  -thing is that the whole script that can be thousand lines is being printed
  -to error_log file as a code that the server has tried to
  -<CODE>eval().</CODE>
  +The error is simple to fix. When you use <CODE>use strict;</CODE> pragma (and you better do that), all variables should be defined before
  +being used.
   
   <P>
  +The bad thing is that sometimes the whole script that can be of thousands
  +lines is being printed to error_log file as a code that the server has
  +tried to <CODE>eval()uate.</CODE>
  +
  +<P>
   As Doug answered to this question:
   
   <P>
  @@ -131,13 +147,17 @@
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
   <CENTER><H1><A NAME="Can_t_undef_active_subroutine">Can't undef active subroutine</A></H1></CENTER>
   <P>
  -Can't undef active subroutine at
  -/usr/apps/lib/perl5/site_perl/5.005/aix/Apache/Registry.pm line 102. Called
  -frompackage Apache::Registry, filename
  -/usr/apps/lib/perl5/site_perl/5.005/aix/Apache/Registry.pm, line 102 
  -
  +<PRE>  Can't undef active subroutine at /usr/apps/lib/perl5/site_perl/5.005/aix/Apache/Registry.pm line 102. 
  +  Called frompackage Apache::Registry, filename /usr/apps/lib/perl5/site_perl/5.005/aix/Apache/Registry.pm, line 102 
  +</PRE>
   <P>
  -META: ?
  +This problem is caused when, a client drops the connection while httpd is
  +in the middle of a write, httpd timeout happens, sending a SIGPIPE, and
  +Perl in that child is stuck in the middle of it's eval context. This is
  +fixed by the Apache::SIG module which is called by default. This should not
  +happen unless you have code that is messing with $SIG{PIPE}. It's also
  +triggered only when you've changed your script on disk and mod_perl is
  +trying to reload it.
   
   <P>
   <P><B><FONT SIZE=-1><A HREF="#toc">[TOC]</A></FONT></B><HR WIDTH="100%"></P>
  @@ -241,13 +261,13 @@
       <B>
         <FONT SIZE=-1>
   	     Written by <A HREF="mailto:sbekman@iil.intel.com">Stas Bekman</A>.
  -	     <BR>Last Modified at 11/24/98 
  +	     <BR>Last Modified at 12/03/98 
         </FONT>
       </B>
     </TD>
   
     <TD>
  -	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl.gif" ALT="Mod Perl Icon" HEIGHT=30 WIDTH=90></A>
  +	     <A HREF="http://perl.apache.org"><IMG SRC="images/mod_perl2.jpg" ALT="Mod Perl Icon" BORDER=0 HEIGHT=59 WIDTH=150></A>
     </TD>
   
     <TD>
  
  
  

Re: cvs commit: modperl-site/guide config.html .....

Posted by Ask Bjoern Hansen <as...@netcetera.dk>.
On 3 Dec 1998 sbekman@hyperreal.org wrote:

>   Initial release (the previous was an old one :)

Nice work!

Great, keep it up.

You forgot to add a link from '/', I'll do that in a minute.

-- 
ask bjoern hansen - <http://www.netcetera.dk/~ask/>