投げ銭

★当サイトへの投げ銭(PayPal)★

LINK


(無償、寄付歓迎) logo
世界中で使われるISO標準オフィスソフト(MSオフィス互換)

★LibreOfficeの導入事例★
詳細について

人気の投稿(1ヶ月間)

Ad

Ad

投げ銭

★当サイトへの投げ銭(PayPal)★

2011年11月21日月曜日

【Linux CentOS 5.7】 phpMyAdminをYUMでインストールする

CentOS 5.7 64bit版に、phpMyAdminをYUMでインストールする手順メモ


phpMyAdminは、MySQLサーバーを管理・操作するためのGUIインターフェイスを提供する。
httpdと協調して動作するので、ユーザーはブラウザから扱うことができる。


<前提として>
MySQLが次の手順でインストールできていて、同一マシンにphpMyAdminをインストールすることとする。
http://akira-arets.blogspot.com/2011/11/linux-centos-57-mysqlyum.html



■システムのアップデートを行った
[root@localhost ~]# yum update
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-274.7.1.el5 #1 SMP Thu Oct 20 16:21:01 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux


■epelリポジトリを追加する
phpMyAdminは、標準のリポジトリには入っていない。epelリポジトリを追加しておく。
[root@localhost ~]# rpm -ivh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm を取得中
警告: /var/tmp/rpm-xfer.XXXXX: ヘッダ V3 DSA signature: NOKEY, key ID
準備中...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
[root@localhost ~]#


□phpMyAdminの情報を表示させる
[root@localhost ~]# yum info phpMyAdmin
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nara.wide.ad.jp
 * epel: ftp.jaist.ac.jp
 * extras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp

Available Packages
Name       : phpMyAdmin
Arch       : noarch
Version    : 2.11.11.3
Release    : 2.el5
Size       : 4.2 M
Repo       : epel
Summary    : Handle the administration of MySQL over the World Wide Web
URL        : http://www.phpmyadmin.net/
License    : GPLv2+
Description: phpMyAdmin is a tool written in PHP intended to handle the administration of
           : MySQL over the World Wide Web. Most frequently used operations are supported
           : by the user interface (managing databases, tables, fields, relations, indexes,
           : users, permissions), while you still have the ability to directly execute any
           : SQL statement.


■phpMyAdminをインストールする
依存関係にあるhttpdや、phpなどもインストールされた。
[root@localhost ~]# yum install phpMyAdmin
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nara.wide.ad.jp
 * epel: ftp.jaist.ac.jp
 * extras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp
Setting up Install Process
Resolving Dependencies
========================================================================================================================================================================
 Package                                    Arch                              Version                                          Repository                          Size
========================================================================================================================================================================
Installing:
 phpMyAdmin                                 noarch                            2.11.11.3-2.el5                                  epel                               4.2 M
Installing for dependencies:
 GeoIP                                      x86_64                            1.4.8-1.el5                                      epel                               783 k
 apr                                        x86_64                            1.2.7-11.el5_6.5                                 base                               119 k
 apr-util                                   x86_64                            1.2.7-11.el5_5.2                                 base                                79 k
 gd                                         x86_64                            2.0.33-9.4.el5_4.2                               base                               155 k
 gmp                                        x86_64                            4.1.4-10.el5                                     base                               201 k
 httpd                                      x86_64                            2.2.3-53.el5.centos.3                            updates                            1.2 M
 libXpm                                     x86_64                            3.5.5-3                                          base                                44 k
 libmcrypt                                  x86_64                            2.5.8-4.el5.centos                               extras                             105 k
 libxslt                                    x86_64                            1.1.17-2.el5_2.2                                 base                               488 k
 nginx                                      x86_64                            0.8.55-1.el5                                     epel                               389 k
 php                                        x86_64                            5.1.6-27.el5_5.3                                 base                               2.3 M
 php-cli                                    x86_64                            5.1.6-27.el5_5.3                                 base                               2.2 M
 php-common                                 x86_64                            5.1.6-27.el5_5.3                                 base                               153 k
 php-gd                                     x86_64                            5.1.6-27.el5_5.3                                 base                               118 k
 php-mbstring                               x86_64                            5.1.6-27.el5_5.3                                 base                               1.0 M
 php-mcrypt                                 x86_64                            5.1.6-15.el5.centos.1                            extras                              16 k
 php-mysql                                  x86_64                            5.1.6-27.el5_5.3                                 base                                89 k
 php-pdo                                    x86_64                            5.1.6-27.el5_5.3                                 base                                66 k
 pkgconfig                                  x86_64                            1:0.21-2.el5                                     base                                61 k
 postgresql-libs                            x86_64                            8.1.23-1.el5_7.3                                 updates                            197 k

Transaction Summary
========================================================================================================================================================================
Install      21 Package(s)
Upgrade       0 Package(s)

Total download size: 14 M

 Installed:
  phpMyAdmin.noarch 0:2.11.11.3-2.el5

Dependency Installed:
  GeoIP.x86_64 0:1.4.8-1.el5              apr.x86_64 0:1.2.7-11.el5_6.5           apr-util.x86_64 0:1.2.7-11.el5_5.2        gd.x86_64 0:2.0.33-9.4.el5_4.2
  gmp.x86_64 0:4.1.4-10.el5               httpd.x86_64 0:2.2.3-53.el5.centos.3    libXpm.x86_64 0:3.5.5-3                   libmcrypt.x86_64 0:2.5.8-4.el5.centos
  libxslt.x86_64 0:1.1.17-2.el5_2.2       nginx.x86_64 0:0.8.55-1.el5             php.x86_64 0:5.1.6-27.el5_5.3             php-cli.x86_64 0:5.1.6-27.el5_5.3
  php-common.x86_64 0:5.1.6-27.el5_5.3    php-gd.x86_64 0:5.1.6-27.el5_5.3        php-mbstring.x86_64 0:5.1.6-27.el5_5.3    php-mcrypt.x86_64 0:5.1.6-15.el5.centos.1
  php-mysql.x86_64 0:5.1.6-27.el5_5.3     php-pdo.x86_64 0:5.1.6-27.el5_5.3       pkgconfig.x86_64 1:0.21-2.el5             postgresql-libs.x86_64 0:8.1.23-1.el5_7.3

Complete!
[root@localhost ~]#


■httpdを自動起動させる設定を行った
[root@localhost ~]# chkconfig httpd on
[root@localhost ~]# chkconfig --list | grep httpd
httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off


■httpdの設定ファイルを変更した

先ず、設定ファイル変更の前にバックアップを取った。
[root@localhost ~]# cp /etc/httpd/conf.d/phpMyAdmin.conf /etc/httpd/conf.d/phpMyAdmin.conf.orig

設定ファイルを変更した。
下記のように赤文字列の行(Allow from 192.168.0.0/16)を追加し、
192.168.0.0/16ローカルサブネットからphpMyAdminにブラウザからアクセスできるようにした。

[root@localhost ~]# vim /etc/httpd/conf.d/phpMyAdmin.conf
(・・・省略)

<Directory /usr/share/phpMyAdmin/>
   Order Deny,Allow
   Deny from All
   Allow from 127.0.0.1
   Allow from ::1
   Allow from 192.168.0.0/16
</Directory>

<Directory /usr/share/phpMyAdmin/scripts/>
   Order Deny,Allow
   Deny from All
   Allow from 127.0.0.1
   Allow from ::1
   Allow from 192.168.0.0/16
</Directory>

(省略・・・)


■httpdを(再)起動させる
[root@localhost ~]# service httpd restart
httpd を停止中:                                            [失敗]
httpd を起動中:                                            [  OK  ]


■上で設定したローカルサブネット上のブラウザから、このマシンにHTTPで接続した

<例>192.168.X.YがphpMyAdminをインストールしたマシンだとすると、次のURLを使う。
http://192.168.X.Y/phpMyAdmin/index.php
すると、IDとパスワードの入力が求められたので、MySQLで設定したrootとパスワードを使った。
phpMyAdminのインターフェイスにアクセスすることができた。

投げ銭

★当サイトへの投げ銭(PayPal)★

Ad

Ad