1 |
6daefa8c
|
Petr Lukašík
|
phpPgAdmin Installation Guide
|
2 |
|
|
-----------------------------
|
3 |
|
|
|
4 |
|
|
1. Unpack your download
|
5 |
|
|
|
6 |
|
|
If you've downloaded a tar.gz package, execute from a terminal:
|
7 |
|
|
|
8 |
|
|
gunzip phpPgAdmin-*.tar.gz
|
9 |
|
|
tar -xvf phpPgAdmin-*.tar
|
10 |
|
|
|
11 |
|
|
Else, if you've downloaded a tar.bz2 package, execute from a terminal:
|
12 |
|
|
|
13 |
|
|
bunzip2 phpPgAdmin-*.tar.bz2
|
14 |
|
|
tar -xvf phpPgAdmin-*.tar
|
15 |
|
|
|
16 |
|
|
Else, if you've downloaded a zip package, execute from a terminal:
|
17 |
|
|
|
18 |
|
|
unzip phpPgAdmin-*.zip
|
19 |
|
|
|
20 |
|
|
2. Configure phpPgAdmin
|
21 |
|
|
|
22 |
|
|
edit phpPgAdmin/conf/config.inc.php
|
23 |
|
|
|
24 |
|
|
If you mess up the configuration file, you can recover it from the
|
25 |
|
|
config.inc.php-dist file.
|
26 |
|
|
|
27 |
|
|
3. Set up the reports database.
|
28 |
|
|
|
29 |
|
|
If you want to enable reports (which are a useful feature) then go to
|
30 |
|
|
the 'sql' subdirectory and view the SQL script for your database. It
|
31 |
|
|
will contain instructions on how to set up the reports database.
|
32 |
|
|
|
33 |
|
|
4. If you run your PHP installation in safe mode, in order that the database
|
34 |
|
|
dump feature can work correctly, you need to set the 'safe_mode_allowed_env_vars'
|
35 |
|
|
php.ini variable to include the PGPASSWORD and PGUSER environmental variables
|
36 |
|
|
and the safe_mode_exec_dir to include /usr/bin (or wherever the pg_dump
|
37 |
|
|
binaries are found).
|
38 |
|
|
|
39 |
|
|
eg. safe_mode_allowed_env_vars = PHP_,PG
|
40 |
|
|
safe_mode_exec_dir = /usr/bin
|
41 |
|
|
|
42 |
|
|
Given that you usually don't want to allow everything in /usr/bin to
|
43 |
|
|
be executed, you might want to copy the pg_dump and pg_dumpall utilities
|
44 |
|
|
to a directory by themselves.
|
45 |
|
|
|
46 |
|
|
Also, you will need to ensure that your 'pg_dump' and 'pg_dumpall' utilities
|
47 |
|
|
are executable by the PHP process, if you want dump support in phpPgAdmin.
|
48 |
|
|
|
49 |
|
|
Lastly, if you run phpPgAdmin in safe mode, very long running imports,
|
50 |
|
|
exports and transactions may time out and be aborted.
|
51 |
|
|
|
52 |
|
|
5. Enable the statistics collector in PostgreSQL. phpPgAdmin will display
|
53 |
|
|
table and index performance and usage statistics if you have enabled the
|
54 |
|
|
PostgreSQL statistics collector. To enable the collector, uncomment the
|
55 |
|
|
following lines in your postgresql.conf and enable them:
|
56 |
|
|
|
57 |
|
|
stats_start_collector = true
|
58 |
|
|
stats_command_string = true
|
59 |
|
|
stats_block_level = true
|
60 |
|
|
stats_row_level = true
|
61 |
|
|
|
62 |
|
|
6. Browse to the phpPgAdmin installation using a web browser. You might
|
63 |
|
|
need cookies enabled for phpPgAdmin to work.
|
64 |
|
|
|
65 |
|
|
7. IMPORTANT - SECURITY
|
66 |
|
|
|
67 |
|
|
PostgreSQL by default does not require you to use a password to log in.
|
68 |
|
|
We STRONGLY recomment that you enable md5 passwords for local connections
|
69 |
|
|
in your pg_hba.conf, and set a password for the default superuser account.
|
70 |
|
|
|
71 |
|
|
Due to the large number of phpPgAdmin installations that have not set
|
72 |
|
|
passwords on local connections, there is now a configuration file
|
73 |
|
|
option called 'extra_login_security', which is TRUE by default. While
|
74 |
|
|
this option is enabled, you will be unable to log in to phpPgAdmin as
|
75 |
|
|
the 'root', 'administrator', 'pgsql' or 'postgres' users and empty passwords
|
76 |
|
|
will not work.
|
77 |
|
|
|
78 |
|
|
Once you are certain you have properly secured your database server, you
|
79 |
|
|
can then disable 'extra_login_security' so that you can log in as your
|
80 |
|
|
database administrator using the administrator password.
|