Installation
PostgreSQL
PostgreSQL
Installation of PostgreSQL
Install through yum:
download pgdg-<system>-8.4-2.noarch.rpm file from http://yum.pgsqlrpms.org/reporpms/8.4/
[root@system ~]# rpm -ivh pgdg-<system>-8.4-2.noarch.rpm
[root@system ~]# yum -y install postgresql-server postgresql postgresql-libsor
[root@system ~]# yum -y update postgresql-server postgresql postgresql-libs
Install through apt-get:
[root@system ~]# apt-get install postgresql
For manual installation:
Download the .rpm or .deb file(s) and save it to disk.
Binary Distributions: http://www.postgresql.org/download/linux
Install:
[root@system ~]# rpm -ivh postgresql-<version>.rpm postgresql-server-<version>.rpm postgresql-libs-<version>.i386.rpm
or
[root@system ~]# dpkg -i postgresql-<version>.debInitialization of PostgreSQL server:
[root@system ~]# service postgresql initdbConfiguration:
[root@system ~]# chkconfig --level 345 postgresql on
edit the file /var/lib/pgsql/data/pg_hba.conf replase the line
host all all 127.0.0.1/32 identwith this one
host all all 127.0.0.1/32 md5Starting of PostgreSQL server:
[root@system ~]# service postgresql startLogon into the PostgreSQL server:
[root@system ~]# su postgresCreate PostgreSQL user:
[root@system ~]$ psql postgres
could not change directory to "/root"
psql (8.4.2)
Type "help" for help.
postgres=#CREATE USER vpnttg SUPERUSER;Check of PostgreSQL users:
CREATE ROLE
postgres=#ALTER USER vpnttg UNENCRYPTED PASSWORD 'vpnttgpass';
ALTER ROLE
postgres=#SELECT * FROM pg_shadow;Logout from the PostgreSQL server:
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig
----------+----------+-------------+----------+-----------+------------+----------+-----------
postgres | 10 | t | t | t | | |
vpnttg | 16384 | f | t | t | vpnttgpass | |
(2 rows)
postgres=# \qCreate of VPNTTG DB:
[root@system ~]$ exit
[root@system ~]# export PGPASSWORD=vpnttgpassList of PostgreSQL databases:
[root@system ~]# createdb vpnttgdb -h 127.0.0.1 -U vpnttg
[root@system ~]# psql -l -h 127.0.0.1 -U vpnttg
List of databases
Name | Owner | Encoding | Collation | Ctype | Access privileges
-----------+----------+-----------+-----------+-------+-----------------------
postgres | postgres | SQL_ASCII | C | C |
template0 | postgres | SQL_ASCII | C | C | =c/postgres
: postgres=CTc/postgres
template1 | postgres | SQL_ASCII | C | C | =c/postgres
: postgres=CTc/postgres
vpnttgdb | vpnttg | SQL_ASCII | C | C |
(4 rows)
Download:
Extract:
[root@system ~]# unzip vpnttgdb_v1.6.zipInitialization of vpnttgdb databas:
[root@system ~]# psql vpnttgdb -h 127.0.0.1 -U vpnttg < vpnttgdb_v1.6.sqlLogon into the vpnttgdb database:
[root@system ~]# psql vpnttgdb -h 127.0.0.1 -U vpnttgInsert the VPN Server's SNMP and OID parameters:
psql (8.4.2)
Type "help" for help.
vpnttgdb=#
vpnttgdb=# INSERT INTO devices VALUES ('<vpn_server_ip>', '<vpn_server_name>', '<community>', 'ASA');
Logout from the vpnttgdb database:
vpnttgdb=# \q
User Menu
We have 62 guests online