1, Apache download address: http://www.apache.org, the following to 2.0.63 as an example to run the configuration of CGI programs.
2, download the Perl interpreter ActivePerl under Windows, official website: http://www.activestate.com/, the latest version ActivePerl-5.10.0.1003, assuming the installation path is C:\Perl.
3, modify the Apache configuration file httpd.conf:
Copy Code code as follows:
<directory "D:/apache Group/apache2/cgi-bin" >
AllowOverride None
Options None
Order Allow,deny
Allow from all
</Directory>
#AddHandler Cgi-script. CGI
To
Copy Code code as follows:
<directory "D:/apache Group/apache2/cgi-bin" >
AllowOverride None
Options execcgi
Order Allow,deny
Allow from all
</Directory>
AddHandler cgi-script. cgi. pl
4. Write Perl script program hello.pl
Copy Code code as follows:
#! C:\Perl\bin\perl.exe
Print "content-type:text/html", "\ n";
Print "<HTML>", "\ n";
Print "<HEAD>", "\ n";
Print "<TITLE>Perl</TITLE>", "\ n";
Print "</HEAD>", "\ n";
Print "<BODY>", "\ n";
Print "Print "</BODY>", "\ n";
Print "</HTML>", "\ n";
Copy the program to the Apache installation directory under the Cgi-bin folder
5, start the Apache server, open the browser, input http://localhost/cgi-bin/hello.pl
The results show that Hello world