2011/04/17(日)QNAP TS-219P+導入その3

PC::NAS

QNAP TS-219P+導入その3

ipkgインストール

perlなどをインストールする為に、パッケージ管理システムipkgを導入します。作業はブラウザの管理画面から。

  1. アプリケーション > QPKGプラグイン: 「QPKGのダウンロード」ボタンをクリックするとダウンロードページが開くので、「Optware IPKG (Itsy Package Management System)」をダウンロード。
    qpkg1.png
  2. アプリケーション > QPKGプラグイン: 「インストール」タブをクリック→ダウンロードしたqpkgファイルを指定→「インストール」ボタンをクリック。
    qpkg2.png
  3. インストール完了
    qpkg3.png

これでipkgコマンドが使えます。

[~] # which ipkg
/opt/bin/ipkg

perlインストール

まずは、perlがリストに載ってるか確認。

[~] # ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/tsx19/cross/unstable/Packages
Updated list of available packages in /opt/lib/ipkg/lists/tsx19
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/cs08q1armel
Successfully terminated.
[~] # ipkg list | more
~省略~
perl - 5.10.0-6 - Practical Extraction and Report Language.
perl-algorithm-diff - 1.1901-2 - Algorithm-Diff - Compute *intelligent* differences between two files / lists.
perl-appconfig - 1.56-3 - Perl5 module for reading configuration files and parsing command line arguments.
~省略~

perlがあったのでさっそくインストール。インストールパスが /opt/bin/perl だったので、一般的な/usr/bin/perlにもリンクを作っておきます。

[~] # ipkg install perl
Installing perl (5.10.0-6) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/perl_5.10.0-6_arm.ipk
Installing libdb (4.2.52-3) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libdb_4.2.52-3_arm.ipk
Installing gdbm (1.8.3-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/gdbm_1.8.3-2_arm.ipk
Configuring gdbm
Configuring libdb
Configuring perl
Successfully terminated.
[~] # which perl
/opt/bin/perl
[~] # ln -s /opt/bin/perl /usr/bin/perl

次は、apache.confを確認。

[~] # cd /usr/local/apache/conf
[/usr/local/apache/conf] # ls
apache.conf      extra/           mime.types
apache.conf.bak  magic            original/
[/usr/local/apache/conf] # grep cgi-script apache.conf
                AddHandler cgi-script .cgi
[/usr/local/apache/conf] # grep ExecCGI apache.conf

AddHandlerの記載はありますが、ExecCGIの記載がないようなので、viなどで編集します。(vi /usr/local/apache/conf/apache.conf)

編集前。

<Directory "/share/Web">
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>

編集後。

<Directory "/share/Web">
        Options FollowSymLinks MultiViews +ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>

この後NASを再起動(Apacheだけ再起動でもいいかな)すれば、Perl/CGIが動作するようになります。

partedインストール

この前動かなかったpertedですが、これもipkgでインストールしてみます。

[~] # ipkg install parted
Installing parted (1.7.1-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/parted_1.7.1-1_arm.ipk
Installing e2fslibs (1.41.9-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/e2fslibs_1.41.9-1_arm.ipk
Configuring e2fslibs
Configuring parted
Successfully terminated.

さっそくパーティション情報を確認。インストールパスが、/opt/sbin/partedなので注意。

[/opt/sbin] # /opt/sbin/parted
GNU Parted 1.7.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) print

Disk /dev/sda: 5860533167s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start        End          Size         File system  Name     Flags
 1      40s          1060289s     1060250s     ext3         primary
 2      1060296s     2120579s     1060284s     linux-swap   primary
 3      2120584s     5859515969s  5857395386s  ext3         primary
 4      5859515976s  5860511999s  996024s      ext3         primary

単位をセクタに設定してるので、Startが8の倍数ならOKです。

OK キャンセル 確認 その他