Before installing DocuShare you should confirm that DocuShare will be able to connect to the PostgreSQL database. This solution will allow you verify the configuration information that you will be providing in the DocuShare installer is correct.
Note: If you are unable to manually connect to PostgreSQL via the manual test listed below then the DocuShare installer will also be unable to connect.
· The postgresql.conf file and the pg_hba.conf file must already be configured properly based on your install environment. (See related solution link How To Enable PostgreSQL TCP/IP Connectivity listed at the bottom of the page)
Note: You must be an Administrator to perform this solution
Note: You can connect to Postgres using the psql utility. You must be logged in with user postgres in order to use this utility. ROOT has too much privilege to use this. All Postgres commands must be run from the postgres bin directory.
To test the connection to the PostgreSQL Database:
1. Open a Terminal window
2. Change into the postgres bin directory
Example: cd /usr/local/pgsql/bin
Note: Depending on your install environment the path to the bin directory may vary.
3. Type su – postgres and press Enter. This will change the logged in to the postgres user
Note: Before manually testing the database connection you must have a database created. You can create the Docushare database before installing DocuShare and make use of it during the install.
Example: ./createdb Docushare
The example above will create a database name called Docushare.
4. Type ./psql –h hostname database and press Enter
Where hostname is the name you will be providing DocuShare for the PostgreSQL Database hostname in the DocuShare Installer.
Note: It is very important that the manual Postgres Database test is the same information that you will be providing the DocuShare Installer for the Postgres Database when manually testing the PostgreSQL connection.
Example: ./psql -h RH4.xerox.com Docushare
In the example above RH4.xerox.com is the hostname and Docushare is the database name that DocuShare will be connecting to. When DocuShare and Postgres are both installed on the same server, the use of localhost for server name requires less configuration.
Note: If you try to connect without the hostname option you are not testing your configurations that will allow DocuShare to connect and this could potentially allow an install to fail.
Note: The configuration file in DocuShare uses an IP address. Verify that the hostname specified in the test above can be resolved to IP using either a DNS entry or a hosts file.
5. If you have successfully connected you should see a message similar the example below.
Example: [postgres@RH4 bin]$ ./psql –h rh4.xerox.com Docushare
Welcome to psql 8.2.9, the PostgreSQL interactive terminal
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
If you receive an error or are prompted for a password, see the Unable to Connect section at the bottom of this solution.
6. Once you have successfully tested the database connection information, proceed with installing DocuShare and configuring the database connection information, used in the testing above, in the DocuShare installer.
Unable to Connect
If you receive an error during the connection test above, the DocuShare installer will fail to pre-configure the database.
There are 2 different scenarios related to the pg_hba.conf configuration that can be returned.
· psql: FATAL: no pg_hba.conf entry for host hostname
This error indicates that the hostname that you specified is not configured as a valid host in the configuration file (pg_hba.conf) or name resolution is not working
· password prompt (not really an error).
This indicates that DocuShare will also be prompted to provide credentials that it will be unable to provide. To resolve this issue the entry in the pg_hba.conf for the host must be set to trust and not md5.
Note: The authentication set to trust can be changed back to md5 if required after the installation for security purposes. However, if authentication is not set to trust during the initial install of DocuShare then it will fail. (See related solution link How To Change the PostgreSQL Authentication Back to md5 After Installing DocuShare listed at the bottom of the page)
To resolve either of the errors listed above, click the solution link How To Enable PostgreSQL TCP/IP Connectivity listed at the bottom of this page