Perl模块Apache-PageKit安装测试错误

时间:2013-07-11 14:10:46

标签: perl apache mod-perl

我安装了Apache :: PageKit模块,在测试此模块时,它显示以下错误。

但模块的可用性,在它下面使用

bash-3.2$
bash-3.2$ perl -MApache::PageKit -e1
bash-3.2$

bash-3.2$ ./t/TEST -start-httpd
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl /install/others/Apache-PageKit-1.14/t/TEST -start-httpd --documentroot '/install/others/Apache-PageKit-1.14/eg'
/install/others/apache2/bin/httpd  -d /install/others/Apache-PageKit-1.14/t -f /install/others/Apache-PageKit-1.14/t/conf/httpd.conf -D APACHE2 -D PERL_USEITHREADS
using Apache/2.2.25 (prefork MPM)

waiting 60 seconds for server to start: .Syntax error on line 24 of /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf:
Can't locate loadable object for module Apache::URI in @INC (@INC contains: /tmp/apache_test /install/others/Apache-PageKit-1.14/blib/lib /install/others/Apache-PageKit-1.14/blib/arch /install/others/lib/perl5/site_perl/5.8.8 /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/ /install/others/lib64/perl5/5.8.8/x86_64-linux-thread-multi /install/others/lib/perl5/site_perl /install/others/lib/CPAN/lib /install/others/Apache-PageKit-1.14/t /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//mod_perl.pm line 14\nCompilation failed in require at /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf line 28.\nBEGIN failed--compilation aborted\t(in cleanup) Can't locate loadable object for module Apache::URI in @INC (@INC contains: /tmp/apache_test /install/others/Apache-PageKit-1.14/blib/lib /install/others/Apache-PageKit-1.14/blib/arch /install/others/lib/perl5/site_perl/5.8.8 /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/ /install/others/lib64/perl5/5.8.8/x86_64-linux-thread-multi /install/others/lib/perl5/site_perl /install/others/lib/CPAN/lib /install/others/Apache-PageKit-1.14/t /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//mod_perl.pm line 14\nCompilation failed in require at /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf line 28.\nBEGIN failed--compilation aborted at /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf line 28.\n
[  error]
server has died with status 255 (t/logs/error_log wasn't created, start the server in the debug mode)
sh: line 1: 25604 Terminated              /usr/bin/perl /install/others/Apache-PageKit-1.14/t/TEST -start-httpd --documentroot '/install/others/Apache-PageKit-1.14/eg'
bash-3.2$
bash-3.2$
bash-3.2$
bash-3.2$ perl -MApache::URI -e1
bash-3.2$

第24行是<Perl>。所以pagekit无法解析这一行。

bash-3.2$ vi /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf
# WARNING: this file is generated (from /install/others/Apache-PageKit-1.14/t/conf/extra.last.conf.in), do not edit
# generated on Thu Jul 11 08:09:38 2013
# 01: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestConfig.pm:961
# 02: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestConfig.pm:979
# 03: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestConfig.pm:1452
# 04: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestConfig.pm:1564
# 05: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestRun.pm:502
# 06: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestRunPerl.pm:107
# 07: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestRun.pm:713
# 08: /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/TestRun.pm:713
# 09: /install/others/Apache-PageKit-1.14/t/TEST:72

# Apache::Reload is very very helpfull during development,
# but it is not required. So install it and uncomment
# the following lines
#
# PerlModule Apache::Reload
# PerlInitHandler Apache::Reload
# PerlSetVar ReloadAll On

# <Perl >
<Perl>

# It is not necasary to preload this modules, but it helps

我该如何解决这个问题。

感谢
Shanmugam A.

您好,

感谢您的回复,现在我为此组合安装了Perl 5.8.8,Apache 2.2.25,Modperl 2.0.8和Apache2 :: PageKit,我在启动apache时出现以下错误。

bash-3.2$
bash-3.2$ /install/others/apache2/bin/apachectl start
[Mon Jul 15 11:28:10 2013] [error] Can't locate loadable object for module Apache::Constants in @INC (@INC contains: /install/others/lib/perl5/5.8.8 /install/others/lib/perl5/site_perl/5.8.8 /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/ /install/others/lib64/perl5/5.8.8/x86_64-linux-thread-multi /install/others/lib/perl5/site_perl/5.8.8 /install/others/lib/perl5/site_perl /install/others/lib/CPAN/lib /dso/dsoapps/iesdev/qtngsas70/DSOMP/lib /dso/dsoapps/iesdev/qtngsas70/DSOMP/bin. /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 . /install/others/apache2) at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//mod_perl.pm line 14.\nCompilation failed in require at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//ModPerl/P2.pm line 2.\nBEGIN failed--compilation aborted at /install/others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//ModPerl/P2.pm line 2.\nCompilation failed in require at (eval 2) line 3.\n
[Mon Jul 15 11:28:10 2013] [error] Can't load Perl module ModPerl::P2 for server (null):0, exiting...

注意:我在这里设置从Unix到Linux服务器。 在Unix中,它是Apache 1.3.27,mod_perl 1.27 Apache :: PageKit的组合,下面的Apache配置中添加了默认的附加部分

#################################################################
<IfModule mod_perl.c>
  PerlModule ModPerl::P2
  <Location /P2>
     SetHandler perl-script
     PerlHandler ModPerl::P2
     PerlSendHeader On
  </Location>

  PerlModule ModPerl::P1
  <Location /P1>
     SetHandler perl-script
     PerlHandler ModPerl::P1
     PerlSendHeader On
  </Location>

  PerlModule Apache::DBI
#### Entered by Tom Frizzell April 25 2008
  PerlFixupHandler Apache::SIG

</IfModule>

###############################################################
# PageKit setup
PassEnv ORACLE_HOME ORACLE_SID ORACLE_USERID TAPEMON_HOME TAPEMON_LIB

<Perl>
use lib "/chshttp/prod/qtngsas70/DSOMP/lib";
</Perl>

SetHandler perl-script
PerlSetVar PKIT_ROOT /chshttp/prod/qtngsas70/DSOMP/www
PerlSetVar PKIT_SERVER test

PerlHandler +Apache::PageKit
<Perl>
        Apache::PageKit->startup('/chshttp/prod/qtngsas70/DSOMP/www', 'test');
</Perl>

PerlInitHandler +Apache::Reload
# Error Handling
PerlModule Apache::ErrorReport
PerlSetVar ErrorReportHandler display

此配置我已将所有Apache :: PageKit更改为Apache2 :: PageKit以及相应的源代码。我刚刚将文件ModPerl :: P1和ModPerl :: P2从Unix服务器复制到Linux。但它显示如上所述的错误。

我应该知道如何解决这个问题。

由于

您好,

当我访问该页面时显示500内部错误。并且apache日志说(无法在perl模块Apache :: SIG中找到对象方法“is_main”)。我应该知道如何解决这个问题。

bash-3.2$ more error_log
[Sun Jul 14 09:38:12 2013] [notice] Apache/2.2.25 (Unix) configured -- resuming normal operations
[Sun Jul 14 09:40:01 2013] [notice] caught SIGTERM, shutting down
[Tue Jul 16 06:39:59 2013] [notice] Apache/2.2.25 (Unix) mod_perl/2.0.8 Perl/v5.8.8 configured -- resuming normal operations
[Tue Jul 16 06:41:01 2013] [error] [client 10.191.51.22] Can't locate object method "is_main" via package "Apache2::RequestRec" at /install/
others/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi//Apache/SIG.pm line 14.\n

我更新的apache配置是

#################################################################
<IfModule mod_perl.c>
  PerlModule ModPerl::P2
  <Location /P2>
     SetHandler perl-script
     PerlHandler ModPerl::P2
#    PerlSendHeader On
      PerlOptions +ParseHeaders
  </Location>

  PerlModule ModPerl::P1
  <Location /P1>
     SetHandler perl-script
     PerlHandler ModPerl::P1
#    PerlSendHeader On
      PerlOptions +ParseHeaders
  </Location>
  PerlModule Apache::DBI
  PerlFixupHandler Apache::SIG  
  LogFormat "%h %l %u %t \"%r\" %s %b %{SIGPIPE}e"
</IfModule>

###############################################################
# PageKit setup  TAPEMON_HOME TAPEMON_LIB
PassEnv ORACLE_HOME ORACLE_SID ORACLE_USERID 

<Perl>
    use mod_perl2;

    # It is not necasary to preload this modules, but it helps
    # to find errors in your instalation.

    use Apache2::URI ();
    use Apache2::Cookie ();
    use Apache2::Request ();
    use Apache::SessionX ();
    use Apache2::Util ();
    use Compress::Zlib ();
    use File::Find ();
    use HTML::FillInForm ();
    use HTML::Parser ();
    use HTML::Template ();
    use XML::LibXML ();

    use Apache2::PageKit();
    use lib "/dso/dsoapps/iesdev/qtngsas70/DSOMP/lib";
</Perl>


SetHandler perl-script
PerlSetVar PKIT_ROOT /dso/dsoapps/iesdev/qtngsas70/DSOMP/www
PerlSetVar PKIT_SERVER test
PerlHandler +Apache2::PageKit
<Perl>
        Apache2::PageKit->startup('/dso/dsoapps/iesdev/qtngsas70/DSOMP/www', 'test');
</Perl>

PerlInitHandler +Apache2::Reload
# Error Handling
PerlModule Apache2::ErrorReport
PerlSetVar ErrorReportHandler display

我知道怎么解决这个问题

感谢
Shanmugam A.

1 个答案:

答案 0 :(得分:0)

看起来Apache-PageKit只能用于mod_perl1,而不能用于mod_perl2(后者会使用Apache2 :: URI,而不是Apache :: URI)。所以你应该寻找替代方案,或者如果你真的需要这个模块,那么你必须找到一种方法在你的系统上安装Apache1和mod_perl1。