Submit a ticketCall us

Webinar: Web Help Desk for HR, Facilities and Accounting Departments
This webinar will focus on use cases for HR, Facilities and Accounting.

Having a unified ticketing and asset management system for all the departments in your company can provide end-users with a seamless experience and make things easier for your IT team. Yet, with different business tasks and objectives, many departments don’t fully understand the capabilities of Web Help Desk and how the software can be customized for effective use in their departments.
Register Now.

Home > Success Center > Web Help Desk (WHD) > Configure access to an embedded PostreSQL database from multiple hosts

Configure access to an embedded PostreSQL database from multiple hosts

Overview

By default, PostgreSQL does not allow external connections. This article describes how to configure embedded PostgreSQL in Microsoft® Windows®, Linux, and a Virtual Appliance to allow connections from a machine other than the PostgreSQL server.

Environment

  • WHD 12.x and later
  • Linux / CentOS (Virtual Appliance)
  • Microsoft Windows

Steps

Linux/CentOS (Virtual Appliance)

  1. Connect to the virtual appliance VA using an SSH client (such as PuTTY).
  2. Enter admin in the user name and password fields to log in.
  3. Change directories to /data1.
    The Linux path is:
     /usr/local/webhelpdesk/bin/pgsql/var/lib/pgsql/9.2/data
    Commandcd /data1
  4. Use the 'sudo' command to edit the config files with Vi editor. Make a copy of the original file before editing.
    Command: sudo cp pgdata/postgresql.conf pgdata/postgresql.conf.original.
    Command: sudo vi pgdata/postgresql.conf.
  5. In the connections and authentication section, uncomment listen_addresses and set to:
    listen_addresses = '*'
  6. Save your changes.
    Type :w and press Enter. 
  7. Exit vi.
    Type :q and press Enter. 
  8. Edit the pg_hba.conf file. Make a copy of the original file before editing.
    Type: 

        sudo cp pgdata/pg_hba.conf pgdata/pg_hba.conf.original.
        sudo vi pgdata/pg_hba.conf.
    The pg_hba.conf file should contain following lines:

    local all all trust
    host all all 127.0.0.1/32 trust
    host all all    ::1/128 trust
    host all whd 0.0.0.0/0 md5

  9. Add a line with your_ip. your_ip that represents the IP address of the host from which you want to connect with pg Admin.
    For example,

    local all all trust
    host all all 127.0.0.1/32 trust
    host all all your_ip/32 trust
    host all all    ::1/128 trust
    host all whd 0.0.0.0/0 md5

  10. Restart WHD.

    1. Change to the WHD directory.
      Type:
      cd /usr/local/webhelpdesk

    2. Stop Web Help Desk.
      Type:
      ./whd stop

    3. Start Web Help Desk.
      Type:
      ./whd start 

Microsoft Windows

  1. Log in to the Web Help Desk server as an administrator.
  2. Navigate to <WebHelpDesk>\pgsql9\data.
  3. Back up the following files to a separate location:
    - postgresql.conf 
    - pg_hba.conf 
  4. Open the postgresql.conf file in a text editor (such as Notepad).
  5. In the connections and authenticationsection, uncomment listen_addresses and set the parameter to:  listen_addresses = '*'
  6. Save your changes.
  7. Open the pg_hba file in a text editor. 
  8. Locate the following lines: 
    # IPv4 local connections:
    host all all 127.0.0.1/32 password
    # IPv6 local connections:
    host all all ::1/128 password
  9. Add a line with your_ip. your_ip that represents the ip address from which you want to connect with pg Admin.
    For example,
    # IPv4 local connections:
    host all all 127.0.0.1/32 password
    host all all your_IP/32 password
  10. Click Save.
  11. Stop WHD using the Start Menu options (right-click and select Run as Admin).
  12. Start WHD using the Start Menu options (right-click and select Run as Admin).

 

Last modified
10:58, 8 May 2017

Tags

Classifications

Public