Configuring the Apache Web Server to Run Perl 在Apache中运行Perl

Categories: Development Notes; Tagged with: ; @ May 5th, 2012 16:22

1. Install Perl

2. Install Apache & config httpd:

Options Indexes FollowSymLinks
Add ExecCGI to this line. The line should now look like the following:
Options Indexes FollowSymLinks ExecCGI
Next, search for the following:
#AddHandler cgi-script .cgi
Uncomment this line by removing the # in front of the line, and add a .pl to the end of the line. The new line should look like this:
AddHandler cgi-script .cgi .pl

3. Start the server, and check the server environment:


There should be some  environment variables like  DOCUMENT_ROOT/PATH/SCRIPT_FILENAME….

4. Drop a Perl( into the server:

print "Content-type: text/html; charset=utf-8\n\n";
print "<phtml><head><title>Learning Perl</title></head><body>";
print "<h1>PerlPage</h1>";
print "<form action='' method='post'>";
print "<input type=file name=='file'>";
print "<input type=text name='comment' size=20 value=''>";
print "<input type=submit name=enter value='Upload'>";
print "<form>";
print "</body></html>";

you can just drop this file in your ApacheHome/cgi-bin or your site if you have configured the httpd.conf;

5. check the Perl page:





Categories: PHP; Tagged with: ; @ September 9th, 2010 9:30

本以为是在httpd.conf中可直接修改TimeOut, 但未在该文件中发现该参数. 但有很多Include:

# Various default settings
Include conf/extra/httpd-default.conf

果然, 修改/extra/httpd-default.conf即可.


Categories: Linux; Tagged with: ; @ August 5th, 2010 21:34

Apache yum安装, httpd.conf配置, Service操作


// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.