mod_perlインストール記録
以前、mod_perlの環境を構築したので、その思い出を忘れないために記す。
ちなみにインストールしたVERSION情報。
app | version |
---|---|
apache | httpd-2.2.11.tar.gz |
mod_perl | mod_perl-2.0-current.tar.gz |
perl | perl-5.10.0.tar.gz |
mod_perl install
$ tar xvfz ./mod_perl-2.0-current.tar.gz $ cd mod_perl-2.0-current $ perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs $ make # make install
「apxs」とは何ぞや!
Apacheに標準でインストールされていないモジュールを組み込む際に利用するツールと理解している。今回、mod_perlをインストールするに当たって、そのアプリの場所をMP_APXSに覚えさせているわけだ。
apxs ・・・ APache eXtenSion
でだ、上記一連の流れを行えば簡単にインストールできるはずなんだができなんだ。なんでだ、Makefile.PLだんかいでWARNINGが発生している。それがこれ、
************* WARNING ************* Your Perl is configured to link against libgdbm, but libgdbm.so was not found. You could just symlink it to /usr/lib/libgdbm.so.3.0.0 ************* WARNING *************
「libgdbm.so」っていうShared Objectが見つかりませんって事ですね。実際に「/usr/lib」ディレクトリには無かったよ。でもね、「libgdbm.so.2」ってのがあった。と言うわけでソフトリンク作成。
$ ln -s libgdbm.so.2 libgdbm.so
libgdbm.so ・・・ gdbm(GNU DataBase Manager)GNUデータベースマネージャーの共有ライブラリ版
機能的にndbmと大差ない。データベースライブラリ
再度、インストール挑戦なんだが、WARNINGがまた発生している。
[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.
それでも、「$ perl Makefile.PL MP_APXS=/usr/local/apache2/bin/apxs」は完了したので、このWARNINGは後からじっくり見ることにした。と言うよりもこれってhttpd.confに書けよとか言ってるね。インストール後の注意事項と見た。その後、「make」を実行したんだが、できない。エラーがでて途中で処理が止まる。
/usr/bin/ld: cannot find -lperl collect2: ld returned 1 exit status make[1]: *** [mod_perl.so] エラー 1 make[1]: Leaving directory `/home/knoppix/mod_perl-2.0.4/src/modules/perl' make: *** [modperl_lib] エラー 2
最初、理解不能だったんだが・・・
/usr/bin/ld: cannot find -lperl
libperlっていうライブラリモジュールが存在しない可能性がある。実際に存在しなかった。
「$ perl Makefile.PL ・・・」で出来上がるMakefileの中身を見てみた。
$ less Makefile | grep libperl* LIBPERL_A = libperl.a