~ubuntu-branches/ubuntu/trusty/libapache2-mod-rivet/trusty

« back to all changes in this revision

Viewing changes to doc/html/request.html

  • Committer: Package Import Robot
  • Author(s): Massimo Manghi
  • Date: 2013-10-02 11:44:17 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20131002114417-aimbnyf22r39iv39
Tags: 2.1.3-1
* New upstream code 2.1.3 
* Removed package dh-apache2 from Build-Depends
* Undone patch removing distclean target from doc/Makefile.am

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Apache Child Processes Lifecycle and Request Processing</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="index.html" title="Apache Rivet"><link rel="prev" href="installation.html" title="Apache Rivet Installation"><link rel="next" href="directives.html" title="Rivet Apache Directives"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Apache Child Processes Lifecycle and Request Processing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="installation.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="directives.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="section" title="Apache Child Processes Lifecycle and Request Processing"><div class="titlepage"><div><div><hr><h2 class="title" style="clear: both"><a name="request"></a>Apache Child Processes Lifecycle and Request Processing</h2></div></div></div><div class="simplesect" title="Apache Child Process Lifecycle"><div class="titlepage"><div><div><h3 class="title"><a name="idp5494208"></a>Apache Child Process Lifecycle</h3></div></div></div><p style="width:90%">
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Apache Child Processes Lifecycle and Request Processing</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><link rel="home" href="index.html" title="Apache Rivet"><link rel="up" href="index.html" title="Apache Rivet"><link rel="prev" href="installation.html" title="Apache Rivet Installation"><link rel="next" href="directives.html" title="Rivet Apache Directives"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Apache Child Processes Lifecycle and Request Processing</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="installation.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="directives.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="section" title="Apache Child Processes Lifecycle and Request Processing"><div class="titlepage"><div><div><hr><h2 class="title" style="clear: both"><a name="request"></a>Apache Child Processes Lifecycle and Request Processing</h2></div></div></div><div class="simplesect" title="Apache Child Process Lifecycle"><div class="titlepage"><div><div><h3 class="title"><a name="idp100816"></a>Apache Child Process Lifecycle</h3></div></div></div><p style="width:90%">
2
2
            Apache Rivet delegates to the <a class="ulink" href="" target="_top">Multi-Processing Module (MPM)</a>
3
3
            the task of managing the agents responding to network requests. 
4
4
            An MPM is responsible for creating such agents during the start-up, 
23
23
            </p><p style="width:90%">
24
24
                        There are 4 stages in the lifetime of an Apache webserver that are relevant
25
25
                        to Rivet: 
26
 
            </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><h4><a name="idp5544784"></a>Single Process Initialization</h4><div style="margin-bottom:1.5ex ; padding .5ex">
 
26
            </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><h4><a name="idp3118192"></a>Single Process Initialization</h4><div style="margin-bottom:1.5ex ; padding .5ex">
27
27
               Apaches starts up as a single process. During this stage Apache performs 
28
28
               various preliminary tasks including reading and parsing the configuration. 
29
29
                                        After the configuration has been read Rivet sets up some internal resources
39
39
                                in this context are importing namespace commands and loading packages
40
40
                                providing code of general interest for every application to
41
41
                                be served. Also IPC methods can be initialized in this stage.
42
 
                        </div></li><li class="listitem"><h4><a name="idp5548304"></a>Child Process Initialization</h4><div style="margin-bottom:1.5ex ; padding .5ex">
 
42
                        </div></li><li class="listitem"><h4><a name="idp3120496"></a>Child Process Initialization</h4><div style="margin-bottom:1.5ex ; padding .5ex">
43
43
                                Right after the webserver has forked its child processes 
44
44
                                there is a chance to perform specific initialization of their Tcl interpreters.
45
45
               This is the stage where most likely you want to open I/O channels, 
65
65
                                <div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><span style="font-family:monospace"><span class="command"><strong>GlobalInitScript</strong></span></span> has no effect to working interpreters
66
66
                                        when <span style="font-family:monospace"><span class="command"><strong>SeparateVirtualInterps</strong></span></span> is set.
67
67
                                </td></tr></table></div>
68
 
                        </div></li><li class="listitem"><h4><a name="idp5556608"></a>Request Processing and Content Generation</h4><div style="margin-bottom:1.5ex ; padding .5ex">
 
68
                        </div></li><li class="listitem"><h4><a name="idp3125528"></a>Request Processing and Content Generation</h4><div style="margin-bottom:1.5ex ; padding .5ex">
69
69
                 After a child has been initialized it's ready to serve requests. 
70
70
                 A child process' lifetime is almost entirely spent in this phase, waiting
71
71
                 for connections and responding to requests. At every request the URL 
83
83
                 be running within the same "before" and "after" scripts to which 
84
84
                 the programmer can devolve tasks common to every 
85
85
                 page of an application.
86
 
            </div></li><li class="listitem"><h4><a name="idp5561456"></a>Child Process Exit</h4><div style="margin-bottom:1.5ex ; padding .5ex">
 
86
            </div></li><li class="listitem"><h4><a name="idp3128624"></a>Child Process Exit</h4><div style="margin-bottom:1.5ex ; padding .5ex">
87
87
                 If no error condition forces the child process to a premature exit, his
88
88
                 life is determined by the Apache configuration parameters. To reduce
89
89
                 the effects of memory leaks in buggy applications the Apache webserver 
101
101
                 to exit and be replaced by a new one when the workload demands it.
102
102
                 This operation implies the <span style="font-family:monospace"><span class="command"><strong>ChildExitScript</strong></span></span> be
103
103
                 run before the interpreter is actually deleted.
104
 
             </div></li></ol></div></div><div class="simplesect" title="Apache Rivet Error and Exception Scripts Directives"><div class="titlepage"><div><div><h3 class="title"><a name="idp5566048"></a>Apache Rivet Error and Exception Scripts Directives</h3></div></div></div><p style="width:90%">
 
104
             </div></li></ol></div></div><div class="simplesect" title="Apache Rivet Error and Exception Scripts Directives"><div class="titlepage"><div><div><h3 class="title"><a name="idp3131536"></a>Apache Rivet Error and Exception Scripts Directives</h3></div></div></div><p style="width:90%">
105
105
            Rivet is highly configurable and each of the webserver lifecycle stages 
106
106
            can be exploited to control a web application. 
107
107
            Not only the orderly sequence of stages
127
127
                the abnormal condition. Starting with Rivet 2.1.0 <a class="xref" href="abort_page.html" title="abort_page">abort_page</a>
128
128
                accepts a free form parameter that can be retrieved later with the command 
129
129
                <a class="xref" href="abort_code.html" title="abort_code">abort_code</a>
130
 
            </p></div><div class="simplesect" title="Tcl Namespaces in Rivet and the ::request Namespace"><div class="titlepage"><div><div><h3 class="title"><a name="idp5572288"></a>Tcl Namespaces in Rivet and the <span style="font-family:monospace"><span class="command"><strong>::request</strong></span></span> Namespace</h3></div></div></div><p style="width:90%">
 
130
            </p></div><div class="simplesect" title="Tcl Namespaces in Rivet and the ::request Namespace"><div class="titlepage"><div><div><h3 class="title"><a name="idp3135440"></a>Tcl Namespaces in Rivet and the <span style="font-family:monospace"><span class="command"><strong>::request</strong></span></span> Namespace</h3></div></div></div><p style="width:90%">
131
131
                        With the sole exception of .rvt templates, Rivet runs pure Tcl scripts 
132
132
                        at the global namespace. That means that every variable or procedure 
133
133
                        created in Tcl scripts resides by default in the