普段は MySQL ばかり使用しているのですが、PostgreSQL を使用する必要があり、phpPgAdmin を使うことにした。
開発用のサーバには phpPgAdmin がインストールされているが、ブラウザで閲覧できるようにはまだしていなかった。

Open Tech Press | phpPgAdmin:Web開発者向けのPostgresクライアントツール を参考に /usr/share/phpPgAdmin にインストールされている phpPgAdmin をブラウザでアクセス可能にした。

/etc/http/conf/httpd.conf に下記を追加

Alias /phppgadmin /usr/share/phppgadmin/
<DirectoryMatch /usr/share/phppgadmin/>
  Options +FollowSymLinks
  AllowOverride None
  order deny,allow
  deny from all
  allow from localhost
</DirectoryMatch>

これでブラウザから http://example.com/phpPgAdmin/ でアクセスできるようになった。
しかし、PostgreSQL のユーザでログインしようとするとエラーになる。

これは シン石丸の電脳芸事ニッキ: debian 3.1へのphppgadminのインストール後の設定 を参考にして解決。

/etc/postgresql/pg_hba.conf に下記を追加
host all all 127.0.0.1 255.255.255.255 trust

これで無事 phpPgAdmin にログインできました。

関連する投稿