Jul 17 2006
Quick Postgres Install Guide
Installing PostgreSQL
From CleversafeWiki
Jump to: navigation, search
Contents [hide]
1 RPM Installation
1.1 Fedora Core 4
1.2 Centos 4
2 Source Installation
This is just a quick guide on how to install Postgres on a Redhat machine.
]RPM Installation
Fedora Core 4
Goto http://www.postgresql.org/ftp/binary/v8.1.4/linux/rpms/fedora/fedora-core-4/ and download the following RPM packages:
postgresql-libs-8.1.4-1PGDG.i686.rpm
postgresql-8.1.4-1PGDG.i686.rpm
postgresql-server-8.1.4-1PGDG.i686.rpm
As a privileged user, install the RPM packages in the following order:
rpm -ihv postgresql-libs-8.1.4-1PGDG.i686.rpm
rpm -ihv postgresql-8.1.4-1PGDG.i686.rpm
rpm -ihv postgresql-server-8.1.4-1PGDG.i686.rpm
Start PostgreSQL by executing the command ‘/etc/init.d/postgresql start’
In the file ‘/var/lib/pgsql/data/pg_hba.conf’, replace all entries of “ident sameuser” with “trust”
In the file ‘/var/lib/pgsql/data/postgresql.conf’, change the line “max_connections=100″ to “max_connections=500″
Restart PostgreSQL by executing the command ‘/etc/init.d/postgresql restart’
[edit]Centos 4
Goto http://www.postgresql.org/ftp/binary/v8.1.4/linux/rpms/redhat/rhel-as-4/ and download the following RPM packages:
postgresql-libs-8.1.4-1PGDG.i686.rpm
postgresql-8.1.4-1PGDG.i686.rpm
postgresql-server-8.1.4-1PGDG.i686.rpm
As a privileged user, install the RPM packages in the following order:
rpm -ihv postgresql-libs-8.1.4-1PGDG.i686.rpm
rpm -ihv postgresql-8.1.4-1PGDG.i686.rpm
rpm -ihv postgresql-server-8.1.4-1PGDG.i686.rpm
Start PostgreSQL by executing the command ‘/etc/init.d/postgresql start’
In the file ‘/var/lib/pgsql/data/pg_hba.conf’, replace all entries of “ident sameuser” with “trust”
In the file ‘/var/lib/pgsql/data/postgresql.conf’, change the line “max_connections=100″ to “max_connections=500″
Restart PostgreSQL by executing the command ‘/etc/init.d/postgresql restart’
[edit]Source Installation
If your platform does not have an RPM package available, you also have the option to build and install PostgreSQL from source. It is actually a very simple process outlined below:
Login as an unpriviledge user (i.e. a standard user login)
Download the source from ftp://ftp.postgresql.org/pub/source/v8.1.4/postgresql-8.1.4.tar.gz
Extract the source by executing the command ‘tar -xzf postgresql-8.1.4.tar.gz’
Enter the newly created directory, postgresql-8.1.4
Configure the build process: execute ‘./configure’
If any dependencies are reported missing, you will need to install them
Build the software: execute ‘make’
Switch to superuser mode: execute ’su’
Install the software: execute ‘make install’
Create a ‘postgres’ system user: execute ‘adduser postgres’
Create the database directory: execute ‘mkdir /usr/local/pgsql/data’
Change ownership of database directory to ‘postgres’ user: execute ‘chown postgres /usr/local/pgsql/data’
Switch to ‘postgres’ account: execute ’su - postgres’
Initialize the database: execute “/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data”
In the file ‘/usr/local/pgsql/data/postgresql.conf’, change the line “max_connections=100″ to “max_connections=500″
Start the database: /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
Comments Off
