<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[运维进行时]]></title> 
<link>https://blog.liuts.com/index.php</link> 
<description><![CDATA[互联网运维与架构]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[运维进行时]]></copyright>
<item>
<link>https://blog.liuts.com/post//</link>
<title><![CDATA[apache2+mod_perl安装指南]]></title> 
<author>root &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Perl]]></category>
<pubDate>Tue, 21 Aug 2007 15:07:50 +0000</pubDate> 
<guid>https://blog.liuts.com/post//</guid> 
<description>
<![CDATA[ 
	mod_perl 模块：<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>　　wget http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz<br/>　　tar -zxvf mod_perl-2.0-current.tar.gz<br/>　　<br/>　　cd mod_perl-2.0.3　　<br/>　　perl Makefile.PL MP_APXS=/usr/local/apache/bin/apxs<br/>　　make && make test<br/>　　make install<br/>　　<br/>　　apache自动重启模块：<br/>　　wget http://search.cpan.org/CPAN/authors/id/M/MS/MSERGEANT/Apache-Reload-0.07.tar.gz<br/>　　tar -zxvf Apache-Reload-0.07.tar.gz<br/>　　cd Apache-Reload-0.07<br/>　　perl Makefile.PL<br/>　　make install<br/>　　<br/>　　vi /usr/local/apache/conf/httpd.conf<br/>　　LoadModule perl_module modules/mod_perl.so<br/></div></div>测试：<br/>1、mkdir -p /usr/local/apache/perl/modules/Apache<br/>vi Hello.pm<br/><textarea name="code" class="c" rows="15" cols="100">
package Apache::Hello;
use strict;
use warnings;
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => qw(OK);

sub handler &#123;
&nbsp;&nbsp;&nbsp;&nbsp;my $r = shift;
&nbsp;&nbsp;&nbsp;&nbsp;$r->content_type('text/plain');
&nbsp;&nbsp;&nbsp;&nbsp;print "Hello, world! This is an Apache Handler.&#92;n";
&nbsp;&nbsp;&nbsp;&nbsp;return Apache2::Const::OK;
&#125;
1;
</textarea><br/><br/>2、vi /www/Mycgi/cgi-bin/index.cgi<br/>use lib qw(/usr/local/apache/perl/modules);<br/>1;<br/><br/>3、vi /usr/local/apache/conf/httpd.conf<br/><textarea name="code" class="c" rows="15" cols="100">
<VirtualHost *>
 ServerName cgi.sina.net
 ServerAdmin liuts@hainan.net
 ErrorLog /var/log/apache/cgi.sina.net/error.log
 CustomLog /var/log/apache/cgi.sina.net/access.log combined
 DocumentRoot /www/Mycgi
 ScriptAlias /cgi-bin/ "/www/Mycgi/cgi-bin/"

 <Directory "/www/Mycgi/cgi-bin">
&nbsp;&nbsp;SetHandler perl-script
&nbsp;&nbsp;PerlResponseHandler ModPerl::Registry
&nbsp;&nbsp;PerlOptions +ParseHeaders
&nbsp;&nbsp;PerlSendHeader On
&nbsp;&nbsp;Options +ExecCGI
&nbsp;&nbsp;Order deny,allow
&nbsp;&nbsp;Allow from all
 </Directory>

PerlRequire /www/Mycgi/cgi-bin/index.cgi
 <Location /hellow>
&nbsp;&nbsp;SetHandler perl-script
&nbsp;&nbsp;PerlHandler Apache::Hello
 </Location>
</VirtualHost>
</textarea><br/>3、重启apache<br/>/usr/local/apache/bin/apachectl restart<br/><br/>4、http://cgi.sina.com/hellow<br/>Hello, world! This is an Apache Handler.<br/>Tags - <a href="https://blog.liuts.com/tags/cgi/" rel="tag">cgi</a>
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post//#blogcomment</link>
<title><![CDATA[[评论] apache2+mod_perl安装指南]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://blog.liuts.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>