UJP - 技術情報1

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

CPANの基本設定を複写する

CPANの基本設定を複写する


0.改訂履歴

  • 2008.08.05 新規作成

1.はじめに

 このドキュメントでは,複数台のサーバをセットアップする際の,CPANの初期設定を簡略化する為の手順を説明する.

2.CPAN Shellを始めて起動した時

  • 始めてCPAN Shellを起動すると,次の様に動作する.
[root@targetsvr ujpadmin]# perl -MCPAN -e shell

/usr/lib/perl5/5.8.8/CPAN/Config.pm initialized.


CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.

If you do not want to enter a dialog now, you can answer 'no' to this
question and I'll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing 'o conf init' at the cpan prompt.)

Are you ready for manual configuration? [yes]
  • Control+Cキーで一旦停止する.
  • 設定ファイルがないためで,別のマシンでセットアップ済のConfig.pmを設定する.
  • まずは,現在の設定ファイルを確認する.
[root@targetsvr ujpadmin]# cd /usr/lib/perl5/5.8.8/CPAN
[root@targetsvr CPAN]# ls -la
total 72
drwxr-xr-x 2 root root 4096 Aug 5 18:25 .
drwxr-xr-x 43 root root 4096 May 15 15:16 ..
-rw-r--r-- 1 root root 3 Aug 5 18:25 Config.pm
-rw-r--r-- 1 root root 21576 Jan 10 2007 FirstTime.pm
-rw-r--r-- 1 root root 802 Jan 10 2007 Nox.pm
-rw-r--r-- 1 root root 1750 Jan 10 2007 PAUSE2003.pub
-rw-r--r-- 1 root root 2028 Jan 10 2007 SIGNATURE
[root@targetsvr CPAN]# cat Config.pm
1;
[root@targetsvr CPAN]#
  • セットアップを途中で強制停止しているので,何も無いに等しい.

3.他のサーバから定義ファイルを持ってくる

  • 他のサーバで定義済のファイルを確認する.
[root@originalsvr ~]# cat /usr/lib/perl5/5.8.8/CPAN/Config.pm

# This is CPAN.pm's systemwide configuration file. This file provides
# defaults for users, and the values can be changed in a per-user
# configuration file. The user-config file is being looked for as
# ~/.cpan/CPAN/MyConfig.pm.

$CPAN::Config = {
'auto_commit' => q[0],
'build_cache' => q[10],
'build_dir' => q[/root/.cpan/build],
'cache_metadata' => q[1],
'commandnumber_in_prompt' => q[1],
'cpan_home' => q[/root/.cpan],
'dontload_hash' => { },
'ftp' => q[/usr/kerberos/bin/ftp],
'ftp_passive' => q[1],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gpg' => q[/usr/bin/gpg],
'gzip' => q[/bin/gzip],
'histfile' => q[/root/.cpan/histfile],
'histsize' => q[100],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/root/.cpan/sources],
'make' => q[/usr/bin/make],
'make_arg' => q[],
'make_install_arg' => q[],
'make_install_make_command' => q[/usr/bin/make],
'makepl_arg' => q[],
'mbuild_arg' => q[],
'mbuild_install_arg' => q[],
'mbuild_install_build_command' => q[./Build],
'mbuildpl_arg' => q[],
'ncftp' => q[],
'ncftpget' => q[],
'no_proxy' => q[],
'pager' => q[/usr/bin/less],
'prerequisites_policy' => q[ask],
'scan_cache' => q[atstart],
'shell' => q[/bin/bash],
'show_upload_date' => q[0],
'tar' => q[/bin/tar],
'term_is_latin' => q[1],
'term_ornaments' => q[1],
'unzip' => q[/usr/bin/unzip],
'urllist' => [q[ftp://ftp.dti.ad.jp/pub/lang/CPAN/], q[ftp://ftp.kddilabs.jp/
CPAN/], q[ftp://ftp.riken.jp/lang/CPAN/]],
'use_sqlite' => q[0],
'wget' => q[/usr/bin/wget],
};
1;
__END__
[root@originalsvr ~]#
  • この記述の中で,マシン毎に依存する定義は無い事が確認で来た.
  • 複写する.
[root@targetsvr CPAN]# ls -la
total 72
drwxr-xr-x 2 root root 4096 Aug 5 18:31 .
drwxr-xr-x 43 root root 4096 May 15 15:16 ..
-rw-r--r-- 1 root root 1654 Aug 5 18:31 Config.pm
-rw-r--r-- 1 root root 21576 Jan 10 2007 FirstTime.pm
-rw-r--r-- 1 root root 802 Jan 10 2007 Nox.pm
-rw-r--r-- 1 root root 1750 Jan 10 2007 PAUSE2003.pub
-rw-r--r-- 1 root root 2028 Jan 10 2007 SIGNATURE
[root@targetsvr CPAN]#
  • CPAN Shellを実行してみる.
[root@targetsvr CPAN]# perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.7602)
ReadLine support available (try 'install Bundle::CPAN')

cpan>
  • 初期設定の問い合せが行われなかったので,有効となっている事が確認できた.


広告スペース
Google