欢迎大家赞助一杯啤酒🍺 我们准备了下酒菜:Formal mathematics/Isabelle/ML, Formal verification/Coq/ACL2, C++/F#/Lisp
Mod perl
来自开放百科 - 灰狐
(版本间的差异)
第27行: | 第27行: | ||
http://localhost/perl/test.pl | http://localhost/perl/test.pl | ||
http://perl.apache.org/ | http://perl.apache.org/ | ||
+ | |||
+ | [[Category:Apache]] | ||
+ | [[Category:Perl]] |
2010年8月22日 (日) 04:39的版本
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 // apache 1.3 # apt-get install libapache2-mod-perl2 // apache 2.0 # apt-get install apache-perl // 或直接安装支持 perl 的 apache # If the perl module is installed, this will be enabled.
If you have installed the apache-perl package, you don't need the following line.
LoadModule perl_module /usr/lib/apache/1.3/mod_perl.so
<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
分享您的观点