How to Add Perl CGI Script Support to Your Apache Server on Windows

    技术2022-05-11  53

    There are two good links about this topic: http://www.thesitewizard.com/archive/addcgitoapache.shtml    http://www.thescripts.com/serveradministration/webservers/apache/virtual-hosting/app/Install_Apache_Web_Server_Perl_PHP_MySQL_on_Windows.html Steps: 1. Installation of Apache + PHP is skipped there. 2. Download ActivePerl-5.8.8.820-MSWin32-x86-274739.msi from ActiveState website. Install step by step. It's recommended to install the ActivePerl into foler like C:/usr if you want to share the same perl code on Windows and Linux/Unix. Because you don't have to change the header of the perl file "#!/usr/bin/perl". 3. Configure Apache to support Perl CGI     If you don't want to be restricted to running CGI scripts within the ScriptAlias directory in your domain, and want CGI scripts to run anywhere in your domain, add the following line to your "httpd.conf" file.     AddHandler cgi-script .cgi          You can add it yourself manually, but since the default httpd.conf file that is supplied by Apache already comes with that line commented out, the simplest thing would be to search for that string in your existing file, and remove the preceding comment character, that is, remove the "#".          If you want the .pl extension recognised as a CGI script as well, simply append the extension to the list, as follows:     AddHandler cgi-script .cgi .pl          Next, search for the line that says "<Directory /> in the file. It should look something like this:     <Directory />       Options FollowSymLinks       AllowOverride None     </Directory>          Add "+ExecCGI" to the options list. The line now looks like this:     Options FollowSymLinks +ExecCGI      4. Create a test perl page     #!/usr/bin/perl     print "Content-type: text/html/n/n";          print "Hello Perl/n";       

    最新回复(0)