![]() |
Practical mod_perl / HTML Version / | ![]() |
||
![]() |
||||
![]() |
![]() |
|||
![]() |
![]() |
|||
![]() |
||||
|
|
||||
![]() |
![]() |
|||
![]() |
4.6. The Scope of mod_perl Configuration Directives |
![]() |
||
![]() |
||||
![]() |
![]() |
![]() |
||
![]() |
||||
Table 4-1 depicts where the various mod_perl configuration directives can be used.
|
Directive |
Global |
<VirtualHost> |
<Directory> |
|---|---|---|---|
|
PerlTaintCheck |
V |
||
|
PerlWarn |
V |
||
|
PerlFreshRestart |
V |
||
|
PerlPassEnv |
V |
V |
|
|
PerlRequire |
V |
V |
V |
|
PerlModule |
V |
V |
V |
|
PerlAddVar |
V |
V |
V |
|
PerlSetEnv |
V |
V |
V |
|
PerlSetVar |
V |
V |
V |
|
PerlSetupEnv |
V |
V |
V |
|
PerlSendHeader |
V |
V |
V |
|
<Perl> Sections |
V |
V |
V |
The first column represents directives that can appear in the global configuration; that is, outside all sections. Note that PerlTaintCheck, PerlWarn, and PerlFreshRestart can be placed inside <VirtualHost>sections. However, because there's only one Perl interpreter for all virtual hosts and the main server, setting any of these values in one virtual host affects all other servers. Therefore, it's probably a good idea to think of these variables as being allowed only in the global configuration.
The second column represents directives that can appear inside the <VirtualHost>sections.
The third column represents directives that can appear in the <Directory>, <Location>, and <Files>sections and all their regex variants. These mod_perl directives can also appear in .htaccess files.
For example, PerlWarn cannot be used in <Directory> and <VirtualHost>sections. However, PerlSetEnv can be used anywhere, which allows you to provide different behavior in different sections:
PerlSetEnv ADMIN_EMAIL webmaster@example.com
<Location /bar/manage/>
PerlSetEnv ADMIN_EMAIL bar@example.com
</Location>
In this example, a handler invoked from /bar/manage/ will see the ADMIN_EMAIL environment variable as bar@example.com, while other handlers configured elsewhere will see ADMIN_EMAIL as the default value, webmaster@example.com.
 
Continue to:
mod_perl, modperl, Apache, perl, cgi, html, mod_perl, e-commerce, scalability, free, open source, OSS, apache, squid, high availability, modperl, linux, unix, Web, www, mod_perl, webserver, admin, apache, book, webmaster, tools, modperl, guide, docs, documentation, help, mod_perl, perl, information, apache, script, errata, eric cholet, perl, apache, mod-perl, stas bekman, mod_perl, cool, perl, Apache, performance, speed, choice
![]() |
Other projects to check out: meta-religion.com is for those interested in Religious, Spiritual and Esoteric Phenomena. i-want-a-better.com is a community of people discussing what they would like to be improved in their lives and things they use and interact with. You may also want to find a healer in your area or read articles on variety of topics.