=head1 NAME mod_perl 1.0 Win32 Configuration Instructions =head1 Description This document discusses how to configure mod_perl 1.0 under Win32. =head1 Configuration Add this line to F: LoadModule perl_module modules/mod_perl.so Be sure that the path to your Perl binary (eg, F) is in your C environment variable. This can be done either through editing F, if present, or through the I option of the I tab in the I area of the Control Panel. Especially when running Apache as a service, you may also want to add LoadFile "C:/Path/to/Perl/bin/perl56.dll" in F, before loading C, to load your perl C. If you have a C directive enabled in F, you may also need to add AddModule mod_perl.c See the descriptions of the C and C directives in the Apache documents for more details, especially concerning the relative order of these and the C directive. =head1 Registry scripts Using C to speed up cgi scripts may be done as follows. Create a directory, for example, F, which will hold your scripts, such as ## printenv -- demo CGI program which just prints its environment ## use strict; print "Content-type: text/html\n\n"; print "

Environment variables

    "; foreach (sort keys %ENV) { my $val = $ENV{$_}; $val =~ s|\n|\\n|g; $val =~ s|"|\\"|g; print "
  • $_ = \"${val}\"
  • \n"; } #sleep(10); print "
"; Note that Apache takes care of using the proper line endings when sending the I header. Next, insert in F the following directives: Alias /mod_perl/ "/Apache/mod_perl/" SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI PerlSendHeader On whereby the script would be called as http://localhost/mod_perl/name_of_script =head1 Hello World As you will discover, there is much to mod_perl beyond simple speed-up of cgi scripts. Here is a simple I example that illustrates the use of mod_perl as a content handler. Create a file F as follows: package Apache::Hello; use strict; use Apache::Constants qw(OK); sub handler { my $r = shift; $r->send_http_header; $r->print("Hello World!\n"); return OK; } 1; and save it in, for example, the F directory. Next put the following directives in F: PerlModule Apache::Hello SetHandler perl-script PerlHandler Apache::Hello With this, calls to http://localhost/hello will use C to deliver the content. =head1 Apache modules The C repository containing the mod_perl ppm package also contains a number of other Apache modules, such as C, C, and C. However, there may be ones you find that are not available through a repository; in such cases, you might try sending a message to the maintainer of the repository asking if a particular package could be included. Alternatively, you can use the C module to fetch, build, and install the module - see C for details. You will need the B utility for this, download it from http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe (it's a self extracting archive, so run it and then copy the files to somewhere in your I environment variable). =head1 See Also The directions for L, the L, and the L. Help is also available through the archives of and subscribing to the L. =head1 Maintainers Maintainer is the person(s) you should contact with updates, corrections and patches. =over =item * Randy Kobes Erandy@theoryx5.uwinnipeg.caE =back =head1 Authors =over =item * Randy Kobes Erandy@theoryx5.uwinnipeg.caE =back Only the major authors are listed above. For contributors see the Changes file. =cut