linux apache2 perl,在apache 2中添加perl模块

If you are running any web based open source application that is

written in perl, you should be using mod_perl with Apache instead

of running it as CGI. mod_perl is way faster than running a web

application using CGI.

This article explains how to install mod_perl on Apache 2.

First, install Apache 2, if you don’t have it already.

1. Download mod_perl

Download mod_perl from perl.apache.org as shown below.

# cd ~

# tar xvfz mod_perl-2.0-current.tar.gz

# cd mod_perl-2.0.4/

2. Configure mod_perl with Apache2

Specify the location of your Apache 2 installation to the

mod_perl as shown below.

# perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs

Reading Makefile.PL args from @ARGV

MP_APXS = /usr/local/apache2/bin/apxs

no conflicting prior mod_perl version found - good.

Configuring Apache/2.2.15 mod_perl/2.0.4 Perl/v5.8.8

Checking if your kit is complete...

Looks good

Writing Makefile for ModPerl

Writing Makefile for ModPerl::XS

Writing Makefile for mod_perl2

Note: If you encounter the “libgdbm.so was not found. You could

just symlink it to /usr/lib/libgdbm.so.2.0.0″ message, install the

gdbm-devel package as shown below.

# rpm -ivh gdbm-devel-1.8.0-26.2.1.i386.rpm

# rpm -qa | grep gdbm

gdbm-devel-1.8.0-26.2.1

gdbm-1.8.0-26.2.1

At this stage, the mod_perl is still not installed, which you

can verify by checking the contents of the Apache 2 modules

directory.

# /usr/local/apache2/bin/apxs -q LIBEXECDIR

/usr/local/apache2/modules

# ls -l /usr/local/apache2/modules/

total 16512

-rw-r--r-- 1 root

root 9083 May 18 09:59 httpd.exp

-rwxr-xr-x 1 root root 16871365 May 19 03:44 libphp5.so

3. Make and install the mod_perl

First, do a make test, to make sure everything looks good.

# make test

t/special_blocks.t ... ok

All tests successful.

Files=20, Tests=84, 14 wallclock secs ( 0.17 usr 0.06 sys + 9.10 cusr 1.46 csys

= 10.79 CPU)

Result: PASS

Finally, do a make install to install the mod_perl on

Apache2.

# make install

Installing /usr/share/man/man3/Apache::TestReport.3pm

Installing /usr/share/man/man3/ModPerl::Global.3pm

Installing /usr/bin/mp2bug

Appending installation info to

/usr/lib/perl5/5.8.8/i386-linux-thread-multi/perllocal.pod

+--------------------------------------------------------------+

| |

| For details on getting started with mod_perl 2,

see:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值