Perlbal::Manual::Install - Perlbalをインストールするためのステップ、依存、および要求
Perlbal 1.78.
Perlbalのインストールの仕方。
$ perl -MCPAN -e shell
cpan> install Perlbal
the App::cpanminus manpage もまたPerlと全ての依存を素早くインストールすることが得意です。
$ cpanm Perlbal IO::AIO Perlbal::XS::HTTPHeaders
... 理想的なPerlbal環境を与えるでしょう。
マシーン上にperlがある必要があります。まだ無い場合は、それをhttp://www.perl.org/ から取り出すことができます。
Having perl on the machine should give you access to the CPAN shell, one of several possible ways to install and upgrade Perl modules.
CPAN shell を開始します:
$ perl -MCPAN -e shell
次にPerlbalをインストールするようにします:
cpan> install Perlbal
最後に、"make install -- OK" で始まるメッセージを見るでしょう (そうでない場合は、このドキュメントの後の章のトラブルシューティングを参照してください)。
http://search.cpan.org/dist/Perlbal/ に向かい、ダウンロードのリンクを見つけます。ファイルをダウンロードし、解凍します:
$ tar zxvf Perlbal-X.XX.tar.gz
X.XX はバージョン番号を表すことに注意してください。取得した最新のバージョンと置き換えてください。
次にMakefileを作成し実行する必要があります; またPerlbalをインストールする前にテストを実行するでしょう。
$ cd Perlbal-X.XX.tar.gz
$ perl Makefile.PL
$ make
$ make test
$ sudo make install
githubからPerlbalのリポジトリをcloneし、以下のステップに従って手動でインストールすることができます:
$ git clone http://github.com/perlbal/Perlbal.git
$ cd Perlbal
$ perl Makefile.PL
$ make
$ make test
$ sudo make install
the Perlbal::XS::HTTPHeaders manpage がインストールされていて有効にされていることを強くお勧めします。パフォーマンスが乏しい場合には、最初にすることは the Perlbal::XS::HTTPHeaders manpage のインストールです。
$ perl -MCPAN -e shell
cpan> install Perlbal::XS::HTTPHeaders
設定の中でそれを有効にします:
XS enable headers
Perlbal は IO::AIO manpage の可用性を確認し、非同期IO操作を実行するためにそれを利用します。ディスク操作を実行している場合(例えば、Perlbalをwebサーバとして利用)は、the IO::AIO manpage を使うことで応答タイムが改善されるでしょう。
この機能の恩恵を受けるために必要なことは、the IO::AIO manpage をインストールすることだけです:
$ perl -MCPAN -e shell
cpan> install IO::AIO
the IO::AIO manpage をインストールしていない場合は、perlbalを開始する時に警告メッセージが表示されるでしょう。
WARNING: AIO mode disabled or not available. Perlbal will run slowly under load if you're doing any disk operations. (e.g. web_server mode). 良いパフォーマンスのために IO::AIO をインストールします。
Perlbal は(ソースの)conf ディレクトリの中にある設定ファイルのいくつかのサンプルと一緒に出荷されます。
ソースがあるディレクトリに向かい以下のコマンドを使うことで、Perlbalにやらせてみることができます:
$ sudo perlbal -c conf/webserver.conf
ブラウザに localhost:80
を示すと、Perlbalの応答が見えるに違いありません(/usr/share/doc
の内容が表示されます)。
webserver.conf ファイルが ポート80でlistenするPerlbal webサーバをセットアップすることに注意してください。既にポート80でlistenしているなにかがある場合は、そのサービスを止めるか webserver.conf のポート番号を代える必要があります。
また、マシーンに /usr/share/docs
ディレクトリが無い場合は、 ERROR: Directory not found for service docs
エラーメッセージを見るだろうことに注意してください。設定ファイルのディレクトリに何かがあるように変更してください。
手動でPerlbalをインストールしている場合は、どれだけの必要状況が利用できないかを説明するエラーメッセージに遭遇するかもしれません。
user@machine:~/Perlbal-X.XX$ perl Makefile.PL 道具一式が揃っているか調べてください... Looks good Warning: prerequisite BSD::Resource 0 not found. Warning: prerequisite Danga::Socket 1.44 not found. Warning: prerequisite HTTP::Date 0 not found. Warning: prerequisite HTTP::Response 0 not found. Warning: prerequisite Sys::Syscall 0 not found. Writing Makefile for Perlbal
これは、Perlbalを手動でインストールしたため必要条件も手動でインストールする必要があるという、perlbalが指示する方法です。最初の選択肢はそれらをそれぞれ個別にダウンロードし、それぞれについて同じインストール手順を実行します。残念ながら、それらは全て追加の必要条件もありそうです。再帰的に繰り返します。
Alternately, see the following Troubleshooting item: No connection to the internet
.
インターネットへの接続が無い場合にもPerlbalをインストールすることができますが、ソースをどうにかしてマシーンに転送する必要があるでしょう。
Given that Perlbal has other module dependencies from CPAN (and those have their own dependencies too), here's a solution for this problem:
Step 1: インターネットへの接続があるマシーン上で、CPAN::Mini をインストールします:
$ perl -MCPAN -e shell
cpan> install CPAN::Mini
最小限のCPANミラーを作成するためにminicpan
を実行します(それは各モジュールの最新バージョンだけを含みます):
$ minicpan -l /home/user/minicpan/ -r http://cpan.org/
Now grab that directory and record it to something you can read on the other machine (e.g., a DVD, a hard drive).
Once you're on that machine, you can run the CPAN shell and tell it to look for distributions on the local directory where you now have your own CPAN mirror:
$ perl -MCPAN -e shell
cpan> o conf urllist push file:///home/user/path/to/minicpan
cpan> install Perlbal
cpan
にこの変更を記録したい場合は、commitするのを忘れないでください:
cpan> o conf commit
マシーン上に利用可能なコンパイラが無い場合は、おそらく以下のようなエラーで終わるものを見るでしょう:
Failed during this command: DORMANDO/Perlbal-X.XX.tar.gz : writemakefile NO '/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status -1
gcc
のようなものをインストールする必要があります ( http://gcc.gnu.org/を調べてください)。
gcc
をインストールした後で、再びPerlbalをインストールしようとすると、他のエラーメッセージを受け取るかも知れません:
cpan> install Perlbal Running install for module 'Perlbal' Running make for D/DO/DORMANDO/Perlbal-X.XX.tar.gz Has already been unwrapped into directory /home/myself/.cpan/build/Perlbal-X.XX-GFko0J '/usr/bin/perl Makefile.PL INSTALLDIRS=site' returned status -1, won't make Running make test Make had some problems, won't test Running make install Make had some problems, won't install
cpan shell が システムに何も変更が無いと見なし、いくつかのステップをスキップしています。過去を喜んで忘れるつもりだということを教える必要があります:
cpan> look Perlbal
$ rm -rf *
$ exit
これで、再びインストールを試すことができます:
cpan> install Perlbal