| Previous | Next
Running CGI Scripts with mod_perlWhat most people want to do with mod_perl is improve CGI performance. The mod_perl installation assumes this request by enabling the With Apache::Registry, each individual CGI program is compiled and cached the first time it is called (or whenever it is changed) and remains available for all subsequent instances of that CGI script. This process avoids the costs of startup time. Whereas most CGI scripts are kept in cgi-bin, scripts that use Apache::Registry are placed in a separate directory, e.g., perl-bin. The access.conf Apache configuration file needs to point to this directory by setting an alias and defining a handler for this new location: Alias /perl-bin/ /usr/local/apache/perl-bin/ <Location /perl-bin> SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader On Options ExecCGI </Location> Instead of using the If you want to load Perl modules in addition to Apache::Registry, you can use the PerlModule directive: PerlModule CGI If you include this line, you shouldn't need to explicitly CGI scripts in the new directory should work now. However, if you have problems, the mod_perl manpage offers some words of wisdom:
In addition, it is recommended that you should use recent versions of Perl and CGI.pm. You should scan the mod_perl documentation for the latest compatibility news. |