Requirements:
postgresql postgresql-devel postgresql-server
apache
php php-devel php-pgsql
phppgadmin
1. 安裝相依套件
yum install postgresql postgresql-devel postgresql-server
yum install httpd php php-devel php-pgsql
2. 建立Postgresql的管理者帳號密碼
/etc/init.d/postgresql restart
chkconfig postgresql on
vi /var/lib/pgsql/data/postgresql.conf
listen_addresses = 'localhost'
su - postgres
-bash-3.2$ createuser pgadmin (使用者帳號可自訂)
Shall the new role be a superuser? (y/n) y
-bash-3.2$ psql template1
template1=# alter role pgadmin with password 'pgpass'; (密碼請自訂)
template1=# psql \q
-bash-3.2$ exit
vi /var/lib/pgsql/data/pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 md5
/etc/init.d/postgresql restart
3. 配置Phppgadmin
wget http://downloads.sourceforge.net/phppgadmin/phpPgAdmin-5.0.2.tar.gz?download
tar -zxvf phpPgAdmin-5.0.2.tar.gz
mv phpPgAdmin-5.0.2 /var/www/html/phppgadmin
vi /var/www/html/phppgadmin/conf/config.inc.php
$conf['servers'][0]['host'] = 'localhost';
4. 啟動Apache
/etc/init.d/httpd restart
chkconfig httpd on
5. 完成,測試
登入帳號:pgadmin
登入密碼:pgpass
參考文章:
http://phppgadmin.sourceforge.net/doku.php
http://icercat.pixnet.net/blog/post/25514294
沒有留言:
張貼留言