Sophie

Sophie

distrib > PLD > ra > i686 > by-pkgid > 6000f42970817265a1498a30e9a2dba4 > files > 119

apache-mod_python-2.7.8-3.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>3.1 Quick Overview of how Apache Handles Requests</title>
<META NAME="description" CONTENT="3.1 Quick Overview of how Apache Handles Requests">
<META NAME="keywords" CONTENT="modpython">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" href="modpython.css">
<LINK REL="next" href="tut-what-it-do.html">
<LINK REL="previous" href="tutorial.html">
<LINK REL="up" href="tutorial.html">
<LINK REL="next" href="tut-what-it-do.html">
</head>
<body>
<DIV CLASS="navigation">
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="tutorial.html"><img src="icons/previous.gif"
  border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="tutorial.html"><img src="icons/up.gif"
  border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A href="tut-what-it-do.html"><img src="icons/next.gif"
  border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Mod_python Manual</td>
<td><A href="contents.html"><img src="icons/contents.gif"
  border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><img src="icons/blank.gif"
  border="0" height="32"
  alt="" width="32"></td>
<td><A href="genindex.html"><img src="icons/index.gif"
  border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="tutorial.html">3. Tutorial</A>
<b class="navlabel">Up:</b> <a class="sectref" href="tutorial.html">3. Tutorial</A>
<b class="navlabel">Next:</b> <a class="sectref" href="tut-what-it-do.html">3.2 So what Exactly</A>
<br><hr>
</DIV>
<!--End of Navigation Panel-->

<H1><A NAME="SECTION005100000000000000000">&nbsp;</A>
<BR>
3.1 Quick Overview of how Apache Handles Requests
</H1>

<P>
It may seem like a little too much for starters, but you need to
understand what a handler is in order to use mod_python. And it's
really rather simple.

<P>
Apache processes requests in <i class="dfn">phases</i>. For example, the first phase may
be to authenticate the user, the next phase to verify whether that
user is allowed to see a particular file, then (next phase) read the
file and send it to the client. Most requests consist of two phases:
(1) read the file and send it to the client, then (2) log the
request. Exactly which phases are processed and how varies greatly and
depends on the configuration.

<P>
A handler is a function that processes one phase. There may be more
than one handler available to process a particular phase, in which
case they are called in sequence. For each of the phases, there is a
default Apache handler (most of which by default perform only very
basic functions or do nothing), and then there are additional handlers
provided by Apache modules, such as mod_python.

<P>
Mod_python provides every possible handler to Apache. Mod_python
handlers by default do not perform any function, unless specifically
told so by a configuration directive. These directives begin with
"<tt class="samp">Python</tt>" and end with "<tt class="samp">Handler</tt>"(e.g. <code>PythonAuthenHandler</code>) and associate a phase with a Python
function. So the main function of mod_python is to act as a dispatcher
between Apache handlers and Python functions written by a developer
like you.

<P>
<a name='l2h-13'>&nbsp;</a>The most commonly used handler is <code>PythonHandler</code>. It handles the
phase of the request during which the actual content is provided. We
will refer to this handler from here on as <i class="dfn">generic</i> handler. The
default Apache action for this handler would be to read the file and
send it to the client. Most applications you will write will use this
one handler. If you insist on seeing all the possible handlers, refer
to Section <A href="directives.html#directives">5</A>, <em class='citetitle'><a
 href='directives.html'
 title='Apache Directives'
 >Apache Directives</a></em>.

<P>

<DIV CLASS="navigation">
<p><hr>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="tutorial.html"><img src="icons/previous.gif"
  border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="tutorial.html"><img src="icons/up.gif"
  border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A href="tut-what-it-do.html"><img src="icons/next.gif"
  border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Mod_python Manual</td>
<td><A href="contents.html"><img src="icons/contents.gif"
  border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><img src="icons/blank.gif"
  border="0" height="32"
  alt="" width="32"></td>
<td><A href="genindex.html"><img src="icons/index.gif"
  border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="tutorial.html">3. Tutorial</A>
<b class="navlabel">Up:</b> <a class="sectref" href="tutorial.html">3. Tutorial</A>
<b class="navlabel">Next:</b> <a class="sectref" href="tut-what-it-do.html">3.2 So what Exactly</A>
<hr>
<span class="release-info">Release 2.7.8, documentation updated on April 19, 2002.</span>
</DIV>
<!--End of Navigation Panel-->

</BODY>
</HTML>