欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2/Agda, C++/Lisp/Haskell
Mod perl
来自开放百科 - 灰狐
(版本间的差异)
| 第13行: | 第13行: | ||
</Location> | </Location> | ||
</IfModule> | </IfModule> | ||
| − | touch | + | touch test.pl |
| − | + | print "Content-type: text/plain\r\n\r\n"; | |
| − | print " | + | print "Server's environment\n"; |
| − | http://localhost/perl/ | + | foreach ( keys %ENV ) { |
| + | print "$_\t$ENV{$_}\n"; | ||
| + | } | ||
| + | chmod a+rx test.pl | ||
| + | http://localhost/perl/test.pl | ||
http://perl.apache.org/ | http://perl.apache.org/ | ||
2007年2月19日 (一) 23:04的版本
mod_perl是个Apache模块,它巧妙的将perl程序语言封装在Apache web服务器内。在mod_perl下,CGI脚本比平常运行快50倍。另外,可将数据库与web服务器集成在一起,用Perl编写Apache模块,在 Apache的配置文件里面插入Perl代码,甚至以server-side include方式使用Perl。在mod_perl下,Apache不仅仅是一个web服务器,而变成了一个功能完善的程序平台。
# apt-get install libapache-mod-perl
# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
<IfModule mod_alias.c>
Alias /perl/ /var/www/perl/
</IfModule>
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
</IfModule>
touch test.pl
print "Content-type: text/plain\r\n\r\n";
print "Server's environment\n";
foreach ( keys %ENV ) {
print "$_\t$ENV{$_}\n";
}
chmod a+rx test.pl
http://localhost/perl/test.pl
分享您的观点