MySQL and Perl for the Web: Chapter 3 Section 2 (1/5) |
WebReference   current pageTo page 2To page 3To page 4To page 5
Improving Performance with mod_perl  mod_perl Configuration
Apache uses a standard protocol, the Common Gateway Interface
(CGI), to communicate with externally executed scripts such as
those we put in the cgi-bin directory in the preceding chapter.
When a CGI script begins executing, it can assume that Apache
has set up certain environment variables. For example,
REMOTE_ADDR and REQUEST_URI indicate the client's host IP number
and the request path. When Apache uses mod_perl to execute a
script directly, it doesn't set up the CGI environment. In
principle, there is no need, because a script that has direct
access to Apache's internals obviously can extract that
information itself if it wants. But the practical implication of
this is that Perl CGI scripts won't function properly under
mod_perl unless they are rewritten to use the Apache API or
unless something else sets up the CGI environmen