books
Free Books / Computers / Practical mod_perl /

previous page: 4.2.13. PerlWarn and PerlTaintCheck
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 4.3.1. A Sample Startup File

4.3. The Startup File




Description

This section is from the "Practical mod_perl" book, by Stas Bekman and Eric Cholet. Also available from Amazon: Practical mod_perl

At server startup, before child processes are spawned, you can do much more than just preload modules. You might want to register code that will initialize a database connection for each child when it is forked, tie read-only DBM files, fill in shared caches, etc.

The startup.pl file is an ideal place to put code that should be executed when the server starts. Once you have prepared the code, load it in httpd.conf before other mod_perl configuration directives with the PerlRequire directive:

PerlRequire  /home/httpd/perl/lib/startup.pl

Be careful with the startup file. Everything run at server initialization is run with root privileges if you start the server as root (which you have to do unless you choose to run the server on an unprivileged port, numbered 1024 or higher). This means that anyone who has write access to a script or module that is loaded by PerlModule, PerlRequire, or <Perl>sections effectively has root access to the system.

 

Continue to:

  • prev: 4.2.13. PerlWarn and PerlTaintCheck
  • Table of Contents
  • next: 4.3.1. A Sample Startup File

Books by Stas Bekman:















TOP
previous page: 4.2.13. PerlWarn and PerlTaintCheck
  
page up: Practical mod_perl | by Stas Bekman and Eric Cholet
  
next page: 4.3.1. A Sample Startup File

Topics

  • Animals
  • Architecture
  • Arts
  • Business
  • Computers
  • Crafts
  • Fairy Tales
  • Finance
  • Flora and Plants
  • Cooking
  • Gardening
  • Health and Healing
  • History
  • Home Improvements
  • Languages
  • New Age
  • Novels
  • Real Estate
  • Reference
  • Religion
  • Science
  • Society
  • Sports
  • Travel
  • Outdoors


Search

My Books

Headaches Begone! A Systemic Approach To Healing Your Headaches
Don't Let Your Bike Seat Ruin Your Sex Life Book

Discover

  • Answers FAQ

[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007-2021 StasoSphere.com