Plamo-5.2/phpMyAdminインストール(完了)

Plamo-5.2/phpMyAdminインストール(完了)

phpMyAdminのインストール

Mysql を使う場合、必須というほどではないにしても、ブラウザから操作できるphpMyAdmin はとても便利なツールです。インストールは簡単で、最新版をダウンロードして、ブラウザでアクセス可能な場所に展開するだけです。

今回は、ドキュメントルート下に展開し、phpmyadmin とディレクトリ名を変更して使用しようとしたのですが、ここで問題が発生しました。ユーザディレクトリへのアクセスにチルダを使わないようにしている現在の設定では、AliasMatch の正規表現が phpmyadmin にもマッチングしてしまいます。考えてみれば当たり前です。

やっぱり、ユーザディレクトリで運用するというのも面倒ですね。さてどうしたものかですが、httpd.conf を変更するのもこれまた面倒ですので、

# cd /srv/httpd/
# ln -s /home/ユーザ名/public_html htdocs

と、ドキュメントルートをシンボリックリンクにしてしまいました。これってどうなんでしょう? 問題ないのでしょうか? いずれにしても、公開しないテスト用ですので、何か問題が起きたら、また変更しましょう。

と言うことで、再度、自分の public_html 下に phpmyadmin をインストールし、config.sample.inc.php を config.inc.php に変更してアクセスしてみます。

 いやあ簡単ですね。以前は、設定ファイルにいろいろサーバ情報を書き加えたような気がするのですが、今はサーバが localhost なら何もしなくてもOKなんですね。ただ、phpMyAdmin を狙った攻撃も多いそうですので、公開サーバの場合は慎重にやらないといけないとは思います。

で、とりあえず、root でログインしたところ、

mcrypt 拡張がありません。PHP の設定をチェックしてみてください。

phpMyAdmin 環境保管領域が完全に設定されていないため、いくつかの拡張機能が無効になっています。理由についてはこちらをご覧ください。

と、二つの警告が出ます。

 mcrypt 拡張がありません

PHP: Mcrypt – Manual を読みますと、libmcrypt をインストールして、php を –with-mcrypt パラメータ付でコンパイルし直さなくてはいけないようです。

# cd /usr/local/src
# wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz
# tar -zxvf libmcrypt-2.5.8.tar.gz
# cd libmcrypt-2.5.8
# ./configure –prefix=/usr  –disable-posix-threads –enable-dynamic-loading
# make
# make install

これで libmcrypt が入りましたので、php を -with-mcrypt=/usr/lib 付で再コンパイルしインストールします。

その後、php.ini に extension = libmcrypt.so とかするのかと思いましたが、何もしなくても警告が消えてしまいました。

phpMyAdmin 環境保管領域が完全に設定されていないため…

こちらは、警告の「こちら」のリンクをたどっていきますと、

 PMA Database … NG [ ドキュメント ]
一般的なリレーション機能 無効

「ドキュメント」のリンクをクリックしますと、

The requested URL /phpmyadmin/pmadb was not found on this server.

となります。やむを得ず、ググったところ、たくさん情報がありました。要は、phpMyAdmin が使うデータベースをつくり、設定ファイルにデータベース情報を追加しなくてはいけないようです。次のようにしました。

mysql に root でログインし、

MariaDB [(none)]> source /(略)/phpmyadmin/examples/create_tables.sql
MariaDB [(none)]> use phpmyadmin;
MariaDB [phpmyadmin]> grant all on phpmyadmin.* to pma@localhost identified by “password”;

config.inc.php の以下コメントアウトをはずします。

/* User used to manipulate with storage */
$cfg[‘Servers’][$i][‘controlhost’] = ”;
$cfg[‘Servers’][$i][‘controlport’] = ”;
$cfg[‘Servers’][$i][‘controluser’] = ‘pma’;
$cfg[‘Servers’][$i][‘controlpass’] = ‘pmapass’;
/* Storage database and tables */
$cfg[‘Servers’][$i][‘pmadb’] = ‘phpmyadmin’;
$cfg[‘Servers’][$i][‘bookmarktable’] = ‘pma__bookmark’;
$cfg[‘Servers’][$i][‘relation’] = ‘pma__relation’;
$cfg[‘Servers’][$i][‘table_info’] = ‘pma__table_info’;
$cfg[‘Servers’][$i][‘table_coords’] = ‘pma__table_coords’;
$cfg[‘Servers’][$i][‘pdf_pages’] = ‘pma__pdf_pages’;
$cfg[‘Servers’][$i][‘column_info’] = ‘pma__column_info’;
$cfg[‘Servers’][$i][‘history’] = ‘pma__history’;
$cfg[‘Servers’][$i][‘table_uiprefs’] = ‘pma__table_uiprefs’;
$cfg[‘Servers’][$i][‘tracking’] = ‘pma__tracking’;
$cfg[‘Servers’][$i][‘designer_coords’] = ‘pma__designer_coords’;
$cfg[‘Servers’][$i][‘userconfig’] = ‘pma__userconfig’;
$cfg[‘Servers’][$i][‘recent’] = ‘pma__recent’;
$cfg[‘Servers’][$i][‘users’] = ‘pma__users’;
$cfg[‘Servers’][$i][‘usergroups’] = ‘pma__usergroups’;
$cfg[‘Servers’][$i][‘navigationhiding’] = ‘pma__navigationhiding’;
/* Contrib / Swekey authentication */
$cfg[‘Servers’][$i][‘auth_swekey_config’] = ‘/etc/swekey-pma.conf’;

ログインし直すと見事に消えていました。

さて、次はやっとCMSのインストールです。