Install phpPgAdmin on Ubuntu 7.10

Update: These instructions have been tested and work fine in the latest version of Ubuntu (8.04, Hardy Heron).

phpPgAdmin is a web based GUI for administrating a PostgreSQL database server.

Here’s some quick notes on getting it installed easily on Ubuntu 7.10…

In the terminal enter the following:

$ sudo apt-get install phppgadmin

This will set up and install all of the phpPgAdmin packages. It will also set-up and configure Apache and php5 for you too if you haven’t installed these already.

Next we need to create a symlink to phpPgAdmin so that Apache can find it:

$ sudo ln -s /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin.conf

Now if you navigate to http://localhost/phppgadmin you should be greeted with the phpPgAdmin screen. If your user account has a PostgreSQL account however, you will be logged in automagically.

Optionally, if you would like to be able to use the phpPgAdmin interface as the default ‘postgres’ administration account,1 you will need to do the following2

$ sudo gedit /usr/share/phppgadmin/conf/config.inc.php

Now find and change the following line

$conf['extra_login_security'] = true;

to

$conf['extra_login_security'] = false;

Save and close gedit. Now all you need to do is restart Apache.

$ sudo /etc/init.d/apache2 reload

Now if you head on over to http://localhost/phppgadmin all should be ready for you.


  1. I am assuming here that you have set-up your PostgreSQL server using my set-up instructions and therefore have a password protected ‘postgres’ account and that logins require passwords. 

  2. Please make sure you have read the above footnote and understand the security implications of allowing this type of access to your database server - if you have not secured your administration accounts, do it now! 

Spread the Word
  • Twitter
  • del.icio.us
  • Digg
  • Facebook
  • Google Bookmarks
  • Reddit
  • NewsVine
  • Slashdot
  • connotea
  • HackerNews
  • Print
  • email

About Daz

This is the blog of Darren Oakley
This entry was posted in linux, postgresql and tagged , , , , , . Bookmark the permalink.

13 Responses to Install phpPgAdmin on Ubuntu 7.10

  1. Hi,

    Thanks for the info. I found another symlink was needed on my 7.10 install.

    $ sudo ln -s /usr/share/phppgadmin /var/www/phppgadmin

    I also needed:

    $ sudo ln -s /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin.conf

    so that apache would read in the phppgadmin configuration. Another apache reload read the config after the symlink was created.

    # /etc/init.d/apache2 reload

  2. daz says:

    Great tip, thanks! This also has the added benefit of working nicely with virtual hosts (as the original setup would barf if you started to use virtual hosts).

    Will add this to the above. :)

  3. Kjelle says:

    Heya, I followed your instructions but I cannot login on phppgadmin, not with postgres, not with my account. Do you have any hints on how I can debug this? Thanks!

  4. nando says:

    GREAT MANUAL!

  5. bezprym says:

    su -c 'createuser -P admin' postgres Enter password for new role: Enter it again:
    Shall the new role be a superuser? (y/n) y CREATE ROLE

    You need of course, php5-pgsql

  6. Daz says:
    You need of course, php5-pgsql

    That should be installed already - it’s a dependency of phppgadmin.

    For more info on account creation, see here.

  7. Dylan says:

    Hi, I’m trying to do this now on Hardy and having a problem. I’m new to all this so there’s a fine chance I’ve stuffed it up.

    This is what’s happening:

    sudo /etc/init.d/apache2 reload apache2: Syntax error on line 295 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf.d/phppgadmin.conf: No such file or directory …fail!

    When I freshly install phppgadmin the only file inside /etc/phppgadmin/ is config.inc.php — there is no apache.conf. I’ve set up postgres with your most recent tutorial. Some guidance will be much appreciated! Thanks.

    Also, it’s a Slicehost box which has been set up with their various instructions (starting at the very beginning with http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1).

  8. Daz says:
    Hi, I’m trying to do this now on Hardy and having a problem. I’m new to all this so there’s a fine chance I’ve stuffed it up.

    Hi Dylan, this sounds quite strange… Let’s check a couple of things…

    When I freshly install phppgadmin the only file inside /etc/phppgadmin/ is config.inc.php — there is no apache.conf.

    Wierd… Okay, try installing again (you did install via apt-get?), if you don’t get the /etc/phppgadmin/apache.conf file this time, here’s a copy of the one off my install - create the file yourself and paste this into it:

    Alias /phppgadmin /usr/share/phppgadmin/

    DirectoryIndex index.php

    Options +FollowSymLinks AllowOverride None

    order deny,allow deny from all allow from 127.0.0.0/255.0.0.0

    allow from all

    php_flag magic_quotes_gpc Off php_flag track_vars On php_flag register_globals On php_value include_path .

    php_flag magic_quotes_gpc Off php_flag track_vars On php_flag register_globals On php_value include_path .

    Finally, delete and re-create the symlink, fingers crossed this should kick things into life for you:

    sudo rm /etc/apache2/conf.d/phppgadmin.conf
    sudo ln -s /etc/phppgadmin/apache.conf /etc/apache2/conf.d/phppgadmin.conf

    Let me know how you get on. :)

  9. Pingback: Switching Rails to PostgreSQL « OLM On Rails

  10. matrix says:

    i have have followed ur steps and able to install phppgadmin and apache2. however i cannot access http://localhost/. can anyone explain me why?

    thanks

  11. ring0 says:

    Great manual! Thanks a lot, I’m a newbie in posgresql.

  12. bigr says:

    Thank you very much, simple and easy guide! Helped me a lot!

  13. Eddie Monge says:

    This works on 9.10 as well with the only exception is that 9.10 automatically creates the symlink for you.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">