From Alpine Linux
Jump to: navigation, search

phpPgAdmin is a web-based administration tool for PostgreSQL.

Install lighttpd, PHP, and postgresql

Install the additional packages:

apk add lighttpd php-common php-iconv php-json php-gd php-curl php-xml php-pgsql php-imap php-cgi fcgi

apk add php-pdo php-pdo_pgsql php-soap php-xmlrpc php-posix php-mcrypt php-gettext php-ldap php-ctype php-dom

Configure Lighttpd

vi /etc/lighttpd/lighttpd.conf

Uncomment line:

include "mod_fastcgi.conf"

Start lighttpd service and add to needed runlevel

rc-service lighttpd start && rc-update add lighttpd default

Install extra packages

apk add postgresql postgresql-client php-pgsql

Configuring postgresql

/etc/init.d/postgresql setup

Starting http service and adding to boot.

/etc/init.d/postgresql start && rc-update add postgresql default

Installing phpPgAdmin

Create a directory named webapps

mkdir -p /usr/share/webapps/

Download the latest release of phpPgAdmin.

cd /usr/share/webapps/ wget

Unpack and delete the tar file

tar zxvf phpPgAdmin-5.0.2.tar.gz rm phpPgAdmin-5.0.4.tar.gz

Change the folder name

mv phpPgAdmin-5.0.4 phppgadmin

Copy the sample config file name

cp /usr/share/webapps/phppgadmin/conf/ /usr/share/webapps/phppgadmin/conf/

Change the folder permissions

chmod -R 777 /usr/share/webapps/

Create a symlink to the phpPgAdmin folder

ln -s /usr/share/webapps/phppgadmin/ /var/www/localhost/htdocs/phppgadmin

Log on your phpPgAdmin

Browse to: http://WEBSERVER_IP_ADDRESS/phppgadmin and logon to phpPgAdmin using postgresql user and password.

Note: If you are using the Alpine ACF, or if you change the port in the lighttpd.conf file, the go to the port you set. e.g: if you set the port to 8080, then browse to: http://WEBSERVER_IP_ADDRESS:8080/phppgadmin