To configure PostgreSQL TCP/IP connectivity for DocuShare:
1. Modify the postgresql.conf file listen addresses
This solution should only be used if you have PostgreSQL installed on a different Server than DocuShare and/or are using the IP Address or Hostname to connect to the PostgreSQL database.
Note: By default, the DocuShare installer pre-populates the Server hostname as the database hostname. If you change the database hostname to localhost during the DocuShare install then the postgresql.conf file will not need to be modified because by default postgreSQL allows TCP/IP connectivity to localhost. (proceed to step 2)
Note: This applies to PostgreSQL v8.0 and higher
Note: To check the installed version of PostgreSQL, as postgres user change into the postgres install directory and view the PG_VERSION file. For example, cat /usr/local/pgsql/data/PG_VERSION
To modify the postgresql.conf file:
a. Open a Terminal window
b. su - postgres
c. Type cd /usr/local/pgsql/bin
Note: Depending on your install environment the path may vary
d. Type ./pg_ctl stop -D /usr/local/pgsql/data -m smart to stop PostgreSQL.
Where the path listed after –D is the path to the data directory
e. Update the /usr/local/pgsql/data/postgresql.conf file.
Example: vi /usr/local/pgsql/data/postgresql.conf
f. Search for the line #listen_addresses = 'local_host'
g. Edit the value to ‘*’ this will start postmaster with the TCP/IP connectivity option.
Example: listen_addresses = '*'
Note: If you are using vi as the editor press i to insert text
Note: This has the PostgreSQL engine listening to any TCP/IP sockets. You need to setup the permission for the specific TCP/IP address you are to connect.
h. Save the changes.
Note: If you are using vi as the editor press i to insert then press :wq! to save the changes.
2. Verify the pg_hba.conf file has authentication set to trust
This solution will verify that the authentication method used by PostgreSQL set to trust, which will allow anyone who is authorized to access the PostgreSQL server to connect to the database.
To verify the pg_hba.conf file set to allow trust authentication:
a. Open a Terminal window
b. su - postgres
c. Type cd /usr/local/pgsql/data
Note: Depending on your install environment the path may vary
d. Update the /usr/local/pgsql/data/pg_hba.conf file to allow TCP/IP connectivity to the database.
Example: vi /usr/local/pgsql/data/pg_hba.conf
e. Verify the host entry as shown below. It should be set to trust and not md5.
host all all 127.0.0.1/32 trust
Note: If you are not using localhost to connect to PostgreSQL and will instead be using the hostname, you will need to add an entry for the associated IP for the hostname. See example below.
Example :
Add the following entry to the bottom of the file
host all all x.x.x.x/32 trust
Where the x.x.x.x is the IP address of the target machine. This line allows all users on the target machine to connect to PostgreSQL. You can adjust the configuration to map to the standards within your organization.
f. Restart PostgreSQL
a. Cd to /usr/local/pgsql/bin
b. Enter ./pg_ctl start -D /usr/local/pgsql/data start
This completes the TCP/IP connectivity for PostgreSQL v8.0 and higher.