Installation using PostgreSQL

From LogicalDOC Community Wiki
Revision as of 21:28, 23 June 2009 by Svenarajala (talk | contribs) (Configure PostgreSQL (Linux Ubuntu 8.10))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Configure PostgreSQL 8.3 (Linux Ubuntu 8.10)

Download PostgreSQL

  1. If you do not have PostgreSQL installed yet, open a terminal in Ubuntu and type sudo apt-get install postgresql-8.3 postgresql-client-8.3 postgresql-contrib-8.3
  2. Press Enter

Configure Access

Change postgres User Password

  1. Access the PostgreSQL interactive terminal by typing sudo -u postgres psql template1 in an Ubuntu terminal
  2. Press Enter
  3. At the template1=# prompt, type ALTER USER postgres with encrypted password 'N3wP@ssw0rd!';
  4. Press Enter .
  5. At the template1=# prompt type \q and press Enter to quit the PostgreSQL interactive terminal

Import Additional Schema

  1. In an Ubuntu terminal, type sudo -u postgres psql < /usr/share/postgresql/8.3/contrib/adminpack.sql
  2. Press Enter
  3. Type sudo -u postgres psql < /usr/share/postgresql/8.3/contrib/pgcrypto.sql
  4. Press Enter

Edit the postgresql.conf file

  1. In an Ubuntu terminal type sudo vim /etc/postgresql/8.3/main/postgresql.conf, press Enter
  2. Scroll down to #listen_addresses = 'localhost' located in the CONNECTIONS AND AUTHENTICATION section, under the Connection Settings subsection.
  3. Press I to edit the file
  4. Remove the # to uncomment listen_addresses = 'localhost'
  5. Change listen_addresses = 'localhost' to listen_addresses = '*'
  6. Scroll down to #password_encryption = on in the Security and Authentication subsection
  7. Remove the # to uncomment password_encryption = on
  8. Press Esc, then type :wq to write your changes to disk and quit the editor
  9. Press Enter

Edit the pg_hba.conf file

  1. In an Ubuntu terminal, type sudo vim /etc/postgresql/8.3/main/pg_hba.conf
  2. Scroll down toward the bottom
  3. Press I to edit
  4. Use the # to comment out all the lines:
    # host all all ::1/128 md5
    # local all all ident sameuser
    # local all postgres ident sameuser
  5. Type the following lines at the end of the file:
    local all postgres trust
    local all postgres md5
    host all all md5

    Note: This will be the local network IP range that the server is on.
    Postgresql pg hba conf edit.gif
  6. Press Esc, then type :wq and press Enter to write your changes to disk and quit

Restart PostgreSQL

  1. In an Ubuntu terminal, type sudo /etc/init.d/postgresql-8.3 restart
  2. Press Enter

Configure Database for Logicaldoc

  1. In an Ubuntu terminal, type sudo –u postgres createdb logicaldocdb and press Enter
  2. Type sudo –u postgres psql logicaldocdb and press Enter
    Note: If prompted for a password, use the postgres password 
  3. At the PostgreSQL interactive terminal prompt, type CREATE ROLE logicaldocgroup INHERIT;
  4. Press Enter
  5. Type CREATE ROLE logicaldocservice LOGIN NOINHERIT;
  6. Press Enter
  7. Type GRANT logicaldocgroup TO logicaldocservice;
  8. Press Enter
  9. Type ALTER USER logicaldocservice with encrypted password 'LogicaldocPassword';
  10. Press Enter
  11. Type ALTER DATABASE logicaldocdb OWNER TO logicaldocgroup;
  12. Press Enter
  13. Type \q and press Enter to return to the Ubuntu terminal prompt