・ Web系SE募集 (技術開発部開発系エンジニア・Java/Tomcat 420万円~750万円)
   ・ 社内SE募集 (業務系システムの開発・社内イントラ)

mod_perl2の最近のブログ記事

インストールした mod_perl2 の動作確認を Apache::Test で行う。

※mod_perl2のインストールは次の手順で行う。

※ Apache::Test は、mod_perl2をインストールする前に、install Bundle::Apache2 した時にインストールされます。


ファイル構成
$ tree ModPerlTest-0.01
ModPerlTest-0.01
|-- Changes
|-- MANIFEST
|-- META.yml
|-- Makefile.PL
|-- README
|-- lib
|   |-- ModPerlTest
|   |   |-- ResponseCleanup.pm
|   |   `-- ResponseHandler.pm
|   `-- ModPerlTest.pm
`-- t
    |-- 00_compile.t
    |-- 01_resp1.t
    |-- 01_resp2.t
    |-- 02_respClean.t
    |-- TEST
    |-- TEST.PL
    |-- conf
    |   `-- extra.conf.in
    `-- response
        `-- ModPerlTest
            `-- ResponseTestHandler.pm

6 directories, 16 files

設定ファイル extra.conf.in

LoadModule apreq_module    /usr/local/apache2/modules/mod_apreq2.so

<location responsehandler="">
        SetHandler perl-script
        PerlResponseHandler ModPerlTest::ResponseHandler
</location> 

<location responsecleanup="">
        SetHandler perl-script
        PerlResponseHandler ModPerlTest::ResponseCleanup
</location>  

ModPerlTest::ResponseHandler

パラメータを受けて返す レスポンスハンドラ

package ModPerlTest::ResponseHandler;

use Apache2::RequestUtil ();
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => ':common';
use Apache2::Request;

use strict;
use 5.008_001;
our $VERSION = '0.01';

sub handler {
        my $r = shift;
        my $query  = Apache2::Request->new($r);
        my $param = $query->param if( $query->param );
        $param ||= {};
        my $input = $param->{input} || '';
        $r->content_type('text/html');
        $r->puts(__PACKAGE__ ."\t". $input);
        return Apache2::Const::OK;
}

1;
__END__

ModPerlTest::ResponseHandler にリクエストを送るためのテストコード

01_resp1.t

use strict;
use Apache::Test qw(:withtestmore);
use Apache::TestUtil;
use Apache::TestRequest 'GET_BODY';
use Test::More ( tests => 1 );
use URI;

my $input = 'ABC';
my $url = URI->new("/responseHandler?input=$input");
my $data = GET_BODY $url;
is ($data, "ModPerlTest::ResponseHandler\t$input");

1;

01_resp2.t

use strict;
use Apache::Test qw(:withtestmore);
use Apache::TestUtil;
use Apache::TestRequest 'GET_BODY';
use Test::More ( tests => 1 );
use URI;

my $url = URI->new("/responseHandler?input=$$");
my $data = GET_BODY $url;
is ($data, "ModPerlTest::ResponseHandler\t$$");

1;

cleanup_register を使用したレスポンスハンドラ

ModPerlTest::ResponseCleanup

package ModPerlTest::ResponseCleanup;

use Apache2::RequestUtil ();
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => ':common';

use strict;
use 5.008_001;
our $VERSION = '0.01';

sub handler {
        my $r = shift;

        $r->content_type('text/html');
        $r->puts($$);
        $r->pool->cleanup_register(\&cleanup, time);
        return Apache2::Const::OK;
}

use Fcntl qw(:DEFAULT :flock);

sub cleanup{
        my $t = shift;
        my $file = "/tmp/mod_perl_test.$$.txt";
        sysopen(FH, $file, O_WRONLY | O_CREAT) or die "can't open $file: $!";
        print FH join("\t"=> $t, time, $$);
        close FH;
        return Apache2::Const::OK;
}

1;
__END__

ModPerlTest::ResponseCleanup にリクエストを送るためのテストコード

02_respClean.t

use strict;
use Apache::Test qw(:withtestmore);
use Apache::TestUtil;
use Apache::TestRequest 'GET_BODY';
use Test::More ( tests => 1 );
use URI;

my $url = URI->new("/responseCleanup");
my $pid = GET_BODY $url;
my $count=0;
my $fpid;
my ($t1, $t2);
use Fcntl qw(:DEFAULT :flock);
my $file = "/tmp/mod_perl_test.$pid.txt";
while(1){
        last if $count > 10;
        $count++;
        $fpid ||= '';
        sysopen(FH, $file, O_RDONLY) or  next;
        ($t1, $t2, $fpid) = split /\t/,(shift @{[]});
	close FH;
	last;
}
is($pid , $fpid, "($pid , $fpid)");
unlink $file;

1;

レスポンスハンドラ の中に書くテストコード

ModPerlTest::ResponseTestHandler

package ModPerlTest::ResponseTestHandler;

use Apache::Test;
use Apache2::RequestUtil ();
use Apache2::RequestRec ();
use Apache2::RequestIO ();
use Apache2::Const -compile => ':common';
use Apache2::Request;

use strict;
use 5.008_001;
our $VERSION = '0.01';

sub handler {
        my $r = shift;
        plan $r, tests => 1;
        ok ref $r;
        return Apache2::Const::OK;
}

1;

テスト結果

$ perl Makefile.PL
[   info] generating script t/TEST
Checking if your kit is complete...
Looks good
Warning: prerequisite UNIVERSAL::require 0 not found.
Writing Makefile for ModPerlTest


$ make test
cp lib/ModPerlTest/ResponseHandler.pm blib/lib/ModPerlTest/ResponseHandler.pm
cp lib/ModPerlTest/ResponseCleanup.pm blib/lib/ModPerlTest/ResponseCleanup.pm
cp lib/ModPerlTest.pm blib/lib/ModPerlTest.pm
/usr/local/bin/perl -Iblib/arch -Iblib/lib \
        t/TEST  -clean
setting ulimit to allow core files
ulimit -c unlimited; /usr/local/bin/perl /home/suzu/work/ModPerlTest-0.01/t/TEST -clean
APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= APACHE_TEST_APXS= \
        /usr/local/bin/perl -Iblib/arch -Iblib/lib \
        t/TEST  -bugreport -verbose=0
setting ulimit to allow core files
ulimit -c unlimited; /usr/local/bin/perl /home/suzu/work/ModPerlTest-0.01/t/TEST -bugreport -verbose=0
/usr/local/apache2/bin/httpd  -d /home/suzu/work/ModPerlTest-0.01/t -f /home/suzu/work/ModPerlTest-0.01/t/conf/httpd.conf -D APACHE2
using Apache/2.2.9 (prefork MPM)
waiting 60 seconds for server to start: 00:00[Sat Oct 04 00:43:51 2008] [warn] module apreq_module is already loaded, skipping
waiting 60 seconds for server to start: ok (waited 1 secs)
server localhost.localdomain:8529 started
t/00_compile.........................ok
t/01_resp1...........................ok
t/01_resp2...........................ok
t/02_respClean.......................ok
t/modperltest/responsetesthandler....ok
All tests successful.
Files=5, Tests=6,  4 wallclock secs ( 0.09 usr  0.01 sys +  2.52 cusr  0.95 csys =  3.57 CPU)
Result: PASS
server localhost.localdomain:8529 shutdown
$
$ cat ./t/logs/access_log
127.0.0.1 - - [04/Oct/2008:00:43:53 +0900] "GET /index.html HTTP/1.0" 200 795
127.0.0.1 - - [04/Oct/2008:00:43:54 +0900] "GET /responseHandler?input=ABC HTTP/1.0" 200 32
127.0.0.1 - - [04/Oct/2008:00:43:55 +0900] "GET /responseHandler?input=3790 HTTP/1.0" 200 33
127.0.0.1 - - [04/Oct/2008:00:43:55 +0900] "GET /responseCleanup HTTP/1.0" 200 4
127.0.0.1 - - [04/Oct/2008:00:43:56 +0900] "GET /ModPerlTest__ResponseTestHandler HTTP/1.0" 200 217
$ cat ./t/logs/error_log
[Sat Oct 04 00:43:51 2008] [info] Init: Seeding PRNG with 0 bytes of entropy
[Sat Oct 04 00:43:51 2008] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Sat Oct 04 00:43:51 2008] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Sat Oct 04 00:43:51 2008] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Sat Oct 04 00:43:51 2008] [info] Init: Initializing (virtual) servers for SSL
[Sat Oct 04 00:43:51 2008] [info] mod_ssl/2.2.9 compiled against Server: Apache/2.2.9, Library: OpenSSL/0.9.8g
[Sat Oct 04 00:43:51 2008] [warn] module apreq_module is already loaded, skipping
[Sat Oct 04 00:43:51 2008] [info] Init: Seeding PRNG with 0 bytes of entropy
[Sat Oct 04 00:43:51 2008] [info] Init: Generating temporary RSA private keys (512/1024 bits)
[Sat Oct 04 00:43:52 2008] [info] Init: Generating temporary DH parameters (512/1024 bits)
[Sat Oct 04 00:43:52 2008] [info] Init: Initializing (virtual) servers for SSL
[Sat Oct 04 00:43:52 2008] [info] mod_ssl/2.2.9 compiled against Server: Apache/2.2.9, Library: OpenSSL/0.9.8g
[Sat Oct 04 00:43:52 2008] [notice] Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8g mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations
[Sat Oct 04 00:43:52 2008] [info] Server built: Sep 20 2008 19:27:27
[Sat Oct 04 00:43:52 2008] [debug] prefork.c(1001): AcceptMutex: sysvsem (default: sysvsem)
[Sat Oct 04 00:43:57 2008] [info] removed PID file /home/suzu/work/ModPerlTest-0.01/t/logs/httpd.pid (pid=3778)
[Sat Oct 04 00:43:57 2008] [notice] caught SIGTERM, shutting down

今回使用したファイル。

ModPerlTest-0.01.tar.gz


CPANシェルで mod_perl2 をインストールする。」からの続き。


libapreq2 も同じように、CPANシェルからインストールする。

CPANシェルを起動後、Makefile.PL にのパラメータを設定する。

$ cpan
CPAN: File::HomeDir loaded ok (v0.80)

cpan shell -- CPAN exploration and modules installation (v1.9205)
ReadLine support enabled

cpan[1]> o conf init makepl_arg
Every Makefile.PL is run by perl in a separate process. Likewise we
run 'make' and 'make install' in separate processes. If you have
any parameters (e.g. PREFIX, LIB, UNINST or the like) you want to
pass to the calls, please specify them here.

If you don't understand this question, just press ENTER.

Typical frequently used settings:

    PREFIX=~/perl    # non-root users (please see manual for more hints)

 
Parameters for the 'perl Makefile.PL' command? [] --with-expat=/usr/local/apache2



Please remember to call 'o conf commit' to make the config permanent!


cpan[2]> o conf makepl_arg
    makepl_arg         [--with-expat=/usr/local/apache2]
Type 'o conf' to view all configuration items


cpan[3]>

一次的な設定なので、'o conf commit' はしない。


Makefile.PL にのパラメータを設定しないでインストールすると、次の様にエラーとなりインストールは出来ない。

 cpan[1]> install J/JO/JOESUF/libapreq2-2.08.tar.gz
CPAN: Storable loaded ok (v2.18)
Going to read /home/suzu/.cpan/Metadata
  Database was generated on Mon, 22 Sep 2008 18:02:49 GMT
CPAN: LWP::UserAgent loaded ok (v5.814)
CPAN: Time::HiRes loaded ok (v1.9711)

I would like to connect to one of the following sites to get 'authors/01mailrc.txt.gz':

 http://www.perl.org/CPAN/
 ftp://ftp.perl.org/pub/CPAN/

Is it OK to try to connect to the Internet? [yes]
Fetching with LWP:
  http://www.perl.org/CPAN/authors/01mailrc.txt.gz
CPAN: YAML loaded ok (v0.66)
Going to read /home/suzu/.cpan/sources/authors/01mailrc.txt.gz
Going to read /home/suzu/.cpan/build/
........................
(省略)

---- Unsatisfied dependencies detected during ----
----       JOESUF/libapreq2-2.08.tar.gz       ----
    ExtUtils::XSBuilder [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]
(省略)

---- Unsatisfied dependencies detected during ----
----  GRICHTER/ExtUtils-XSBuilder-0.28.tar.gz ----
    Tie::IxHash [requires]
    Parse::RecDescent [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]
(省略)

Checking if your kit is complete...
Looks good
Writing Makefile for Tie::IxHash
cp lib/Tie/IxHash.pm blib/lib/Tie/IxHash.pm
Manifying blib/man3/Tie::IxHash.3
  GSAR/Tie-IxHash-1.21.tar.gz
  /usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/ixhash....ok
All tests successful.
Files=1, Tests=25,  0 wallclock secs ( 0.04 usr  0.05 sys +  0.01 cusr  0.02 csys =  0.12 CPU)
Result: PASS
  GSAR/Tie-IxHash-1.21.tar.gz
  /usr/bin/make test -- OK
Running make install
Prepending /home/suzu/.cpan/build/Tie-IxHash-1.21-Wkktf5/blib/arch /home/suzu/.cpan/build/Tie-IxHash-1.21-Wkktf5/blib/lib to PERL5LIB for 'install'
Password:
(省略)

/usr/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
make[2]: *** [test_cgi] Error 1
make[2]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/module'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/module'
make: *** [all-recursive] Error 1
  JOESUF/libapreq2-2.08.tar.gz
  /usr/bin/make -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 JOESUF/libapreq2-2.08.tar.gz                 : make NO

cpan[2]> bye
Lockfile removed.

この様になった場合、もう一度インストールする前に、次のようにして make clean する。
そうしないと、インストール出来ない。

cpan[3]> clean J/JO/JOESUF/libapreq2-2.08.tar.gz

libapreq2 をインストールする。

cpan[3]> install J/JO/JOESUF/libapreq2-2.08.tar.gz
CPAN: Storable loaded ok (v2.18)
Going to read /home/suzu/.cpan/Metadata
  Database was generated on Sat, 27 Sep 2008 18:26:49 GMT
CPAN: YAML loaded ok (v0.66)
Going to read /home/suzu/.cpan/build/
............................................................................DONE
Found 17 old builds, restored the state of 17
Running make for J/JO/JOESUF/libapreq2-2.08.tar.gz

  CPAN.pm: Going to build J/JO/JOESUF/libapreq2-2.08.tar.gz

perl: 5.10.0 ok
mod_perl2: 2.000004 ok
Apache::Test: 1.31 ok
ExtUtils::MakeMaker: 6.44 ok
ExtUtils::XSBuilder: 0.28 ok
Test::More: 0.8 ok
./configure --enable-perl-glue --with-expat="/usr/local/apache2" --with-apache2-apxs="/usr/local/apache2/bin/apxs" --with-perl="/usr/local/bin/perl"
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
(省略)
waiting 60 seconds for server to start: ..
waiting 60 seconds for server to start: ok (waited 0 secs)
server localhost.localdomain:8529 started
t/api/cookie.........ok
t/api/error..........ok
t/api/module.........ok
t/api/param..........ok
t/apreq/big_input....ok
t/apreq/cgi..........ok
t/apreq/cookie.......ok
t/apreq/inherit......ok
t/apreq/request......ok
t/apreq/upload.......ok
All tests successful.
Files=10, Tests=191, 40 wallclock secs ( 2.79 usr  0.02 sys + 11.79 cusr 14.36 csys = 28.96 CPU)
Result: PASS
[warning] server localhost.localdomain:8529 shutdown
pod2test was not found, skipping inlined tests
make[1]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/glue/perl'
  JOESUF/libapreq2-2.08.tar.gz
  /usr/bin/make test -- OK
Running make install
Prepending /home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/blib/arch /home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/blib/lib to PERL5LIB for 'install'
Password:
(省略)

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apache2/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------


(省略)
----------------------------------------------------------------------
Before you can use mod_apreq2, you must ensure that an appropriate
"LoadModule" line appears in your webserver's config file:
/usr/local/apache2/conf/httpd.conf

LoadModule apreq_module    /usr/local/apache2/modules/mod_apreq2.so
----------------------------------------------------------------------

(省略)
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apache2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

(省略)
Installing /usr/local/share/man/man3/Apache2::Request.3
Installing /usr/local/share/man/man3/APR::Request::Cookie.3
Installing /usr/local/share/man/man3/APR::Request::CGI.3
Writing /usr/local/lib/perl5/site_perl/5.10.0/i686-linux/auto/libapreq2/.packlist
Appending installation info to /usr/local/lib/perl5/5.10.0/i686-linux/perllocal.pod
make[3]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/glue/perl'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/glue'
make[1]: Leaving directory `/home/suzu/.cpan/build/libapreq2-2.08-q8E5Li/glue'
  JOESUF/libapreq2-2.08.tar.gz
  sudo make install  -- OK

cpan[4]>

CPANシェルで mod_perl2 をインストールする。

mod_perl2 のインストールは、root 権限では test がうまく出来ないので、ユーザー権限でCPANシェルを起動してインストールします。

※ユーザー権限でCPANシェルを使うための設定は 「cpan shell (user 権限)」を参照

ちなみに、root 権限でテストをしようとすると、次のようになる。
Running the test suite is important to make sure that the module that
you are about to install works on your system. If you choose not to
run the test suite and you have a problem using this module, make sure
to return and run this test suite before reporting any problems to the
developers of this module.

Skip the test suite? [No]
make: *** [run_tests] Error 1
  GOZER/mod_perl-2.0.4.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports GOZER/mod_perl-2.0.4.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 GOZER/mod_perl-2.0.4.tar.gz                  : make_test NO

mod_perlをインストールする前に、openssl-devel をインストールしておきます。

sudo yum  install openssl-devel

install Bundle::Apache2 で、依存関係にあるモジュールをインストールする。

$ cpan
CPAN: File::HomeDir loaded ok (v0.80)

cpan shell -- CPAN exploration and modules installation (v1.9205)
ReadLine support enabled

cpan[1]> install Bundle::Apache2
CPAN: Storable loaded ok (v2.18)
CPAN: Time::HiRes loaded ok (v1.9711)

I would like to connect to one of the following sites to get 'authors/01mailrc.txt.gz':

 http://www.perl.org/CPAN/
 ftp://ftp.perl.org/pub/CPAN/

Is it OK to try to connect to the Internet? [yes]
  LWP not available

Trying with "/usr/bin/curl -L -f -s -S --netrc-optional" to get
    http://www.perl.org/CPAN/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok (v2.015)
CPAN: YAML loaded ok (v0.66)
Going to read /home/suzu/.cpan/sources/authors/01mailrc.txt.gz
.................

デフォルトのまま進みます。

(省略)
  CPAN.pm: Going to build D/DL/DLAND/Crypt-SSLeay-0.57.tar.gz

=======================================================
Only one OpenSSL installation found at /usr
Consider running 'perl Makefile.PL --default' the next
time Crypt::SSLeay is upgraded to select this directory
automatically thereby avoiding the following prompt.
=======================================================
Which SSL install path do you want to use? [/usr]

BUILD INFORMATION
================================================
ssl library: OpenSSL 0.9.8 in /usr
ssl header:  openssl/ssl.h
libraries:   -L/usr/lib -lssl -lcrypto -lgcc
include dir: -I/usr/include/openssl
================================================
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -lgcc
Writing Makefile for Crypt::SSLeay
The test suite can attempt to connect to public servers
to ensure that the code is working properly. If you are
behind a strict firewall or have no network connectivity,
these tests may fail (through no fault of the code).

Do you want to run the live tests (y/N) ? [N]

sudo でインストールするように,CPAN シェルに設定しているので、途中パスワードを聞いてきます。

  DLAND/Crypt-SSLeay-0.57.tar.gz
  /usr/bin/make test -- OK
Running make install
Prepending /home/suzu/.cpan/build/Crypt-SSLeay-0.57-SjXk3a/blib/arch /home/suzu/.cpan/build/Crypt-SSLeay-0.57-SjXk3a/blib/lib to PERL5LIB for 'install'
Password:

デフォルトのまま進みます。

Warning: prerequisite FCGI 0.67 not found.
Writing Makefile for CGI
---- Unsatisfied dependencies detected during ----
----          LDS/CGI.pm-3.42.tar.gz          ----
    FCGI [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes]

インストール後の確認。

 cpan[2]> install Bundle::Apache2
Crypt::SSLeay is up to date (0.57).
Devel::CoreStack is up to date (1.3).
Devel::Symdump is up to date (2.08).
Digest::MD5 is up to date (2.36_01).
URI is up to date (1.37).
Net::Cmd is up to date (2.29).
MIME::Base64 is up to date (3.07_01).
HTML::Tagset is up to date (3.20).
HTML::Parser is up to date (3.56).
HTML::HeadParser is up to date (2.22).
LWP is up to date (5.814).
IPC::Run3 is up to date (0.042).
CGI is up to date (3.42).
Chatbot::Eliza is up to date (1.04).
Compress::Zlib is up to date (2.015).
Devel::Symdump is up to date (2.08).
HTML::HeadParser is up to date (2.22).
IPC::Run3 is up to date (0.042).
LWP is up to date (5.814).

cpan[3]>

mod_perl-2.0.4.tar.gz をインストールする。

cpan[3]> install G/GO/GOZER/mod_perl-2.0.4.tar.gz
Running make for G/GO/GOZER/mod_perl-2.0.4.tar.gz

  CPAN.pm: Going to build G/GO/GOZER/mod_perl-2.0.4.tar.gz

no conflicting prior mod_perl version found - good.

Next we need to know where the 'apxs' script is located. This script
provides a lot of information about the Apache installation, and makes
it easier to find things on your system. Normally it's located in the
same directory as the 'httpd' executable.

If you don't yet have Apache installed you can build Apache against
the Apache source code, but you won't be able to run the test suite (a
very important step). Therefore you may want to install Apache before
proceeding.


Please provide a full path to 'apxs' executable
(press Enter if you don't have it installed):  /usr/local/apache2/bin/apxs

途中で、apxs のPATHを聞かれるので入力する。

Configuring Apache/2.2.9 mod_perl/2.0.4 Perl/v5.10.0
Checking if your kit is complete...
Looks good
Subroutine MY::postamble redefined at ./Makefile.PL line 167.
Subroutine MY::constants redefined at ./Makefile.PL line 181.
[   info] generating script t/TEST
[   info] generating script ./t/cgi-bin/cookies.pl
[   info] generating script ./t/cgi-bin/next_available_port.pl
Writing Makefile for Apache::Test
Checking for File::Spec...ok
Checking for Cwd...ok
[   info] generating script t/TEST
Checking if your kit is complete...
Looks good
Writing Makefile for ModPerl::Registry
Writing Makefile for APR::Base64
Writing Makefile for APR::Brigade
Writing Makefile for APR::Bucket
Writing Makefile for APR::BucketAlloc
Writing Makefile for APR::BucketType
Writing Makefile for APR::Date
(省略)
[warning] mod_perl dso library will be built as mod_perl.so
[warning] You'll need to add the following to httpd.conf:
[warning]
[warning]   LoadModule perl_module modules/mod_perl.so
[warning]
[warning] depending on your build, mod_perl might not live in
[warning] the modules/ directory.

[warning] Check the results of
[warning]
[warning]   $ /usr/local/apache2/bin/apxs -q LIBEXECDIR
[warning]
[warning] and adjust the LoadModule directive accordingly.

(省略)
waiting 90 seconds for server to start: ...
waiting 90 seconds for server to start: ok (waited 1 secs)
server localhost.localdomain:8529 started
t/206................ok
t/304................ok
t/404................ok
t/500................ok
t/bad_scripts........ok
t/basic..............ok
t/bin_resp...........ok
t/cgi................ok
t/closure............ok
t/dirindex...........ok
t/fatalstobrowser....skipped: (no reason given)
t/flush..............ok
t/ithreads...........skipped: (no reason given)
t/nph................ok
t/perlrun_extload....ok
t/prefork............ok
t/redirect...........ok
t/regex..............ok
t/rewrite_env........ok
t/special_blocks.....ok
All tests successful.
Files=20, Tests=85, 19 wallclock secs ( 0.52 usr  0.04 sys + 12.79 cusr  4.66 csys = 18.01 CPU)
Result: PASS
[warning] server localhost.localdomain:8529 shutdown
make[1]: Leaving directory `/home/suzu/.cpan/build/mod_perl-2.0.4-s4I7vI/ModPerl-Registry'
  GOZER/mod_perl-2.0.4.tar.gz
  /usr/bin/make test -- OK
Running make install
Prepending /home/suzu/.cpan/build/mod_perl-2.0.4-s4I7vI/blib/arch /home/suzu/.cpan/build/mod_perl-2.0.4-s4I7vI/blib/lib to PERL5LIB for 'install'
Password:

sudo でインストールするように,CPAN シェルに設定しているので、途中パスワードを聞いてきます。

※入力ミスなどで途中失敗したら、次のようになりますので、
  /usr/bin/make test -- OK
Running make install
Prepending /home/suzu/.cpan/build/mod_perl-2.0.4-s4I7vI/blib/arch /home/suzu/.cpan/build/mod_perl-2.0.4-s4I7vI/blib/lib to PERL5LIB for 'install'
Password:
  GOZER/mod_perl-2.0.4.tar.gz
  sudo make install  -- NOT OK
Failed during this command:
 GOZER/mod_perl-2.0.4.tar.gz                  : install NO

cpan[4]> 
make clean する必要がある。
cpan[4]> clean G/GO/GOZER/mod_perl-2.0.4.tar.gz
make clean したら、もう一度インストールし直す。

インストール完了

(省略)
Installing /usr/local/share/man/man3/Apache2::ServerUtil.3
Installing /usr/local/share/man/man3/Apache2::URI.3
Installing /usr/local/share/man/man3/Apache::TestRequest.3
Installing /usr/local/share/man/man3/Apache2::Util.3
Installing /usr/local/share/man/man3/Bundle::Apache2.3
Installing /usr/local/share/man/man3/APR::Error.3
Installing /usr/local/share/man/man3/mod_perl2.3
Installing /usr/local/share/man/man3/ModPerl::PerlRunPrefork.3
Installing /usr/local/share/man/man3/APR::Socket.3
Installing /usr/local/bin/mp2bug
Writing /usr/local/lib/perl5/site_perl/5.10.0/i686-linux/auto/mod_perl2/.packlist
Appending installation info to /usr/local/lib/perl5/5.10.0/i686-linux/perllocal.pod
+--------------------------------------------------------------+
|                                                              |
| For details on getting started with mod_perl 2, see:         |
|                                                              |
|   http://perl.apache.org/docs/2.0/user/intro/start_fast.html |
|                                                              |
|                                                              |
| Found a bug?  File a bug report:                             |
|                                                              |
|   http://perl.apache.org/bugs/                               |
|                                                              |
+--------------------------------------------------------------+
  GOZER/mod_perl-2.0.4.tar.gz
  sudo make install  -- OK

cpan[4]>

このアーカイブについて

このページには、過去に書かれたブログ記事のうちmod_perl2カテゴリに属しているものが含まれています。

前のカテゴリはinstallです。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。