Difference between revisions of "Software Collections:PostgreSQL"

From SME Server
Jump to navigationJump to search
Line 14: Line 14:
 
===Installation===
 
===Installation===
 
To be able to install an application from the Software Collections, one '''must''' install software collections first. Please see [[Software collections]] on how to install this.
 
To be able to install an application from the Software Collections, one '''must''' install software collections first. Please see [[Software collections]] on how to install this.
 +
  
 
====Required repository====
 
====Required repository====
 
After installing Software Collections, the [http://wiki.contribs.org/Scl#tab=PostgreSQL92 '''scl'''] repository for PostgreSQL has to added to the yum repositories. Please see [http://wiki.contribs.org/Scl#tab=PostgreSQL92 '''here'''] on how the enable the [http://wiki.contribs.org/Scl#tab=PostgreSQL92 '''scl-postgresql92'''] repository.
 
After installing Software Collections, the [http://wiki.contribs.org/Scl#tab=PostgreSQL92 '''scl'''] repository for PostgreSQL has to added to the yum repositories. Please see [http://wiki.contribs.org/Scl#tab=PostgreSQL92 '''here'''] on how the enable the [http://wiki.contribs.org/Scl#tab=PostgreSQL92 '''scl-postgresql92'''] repository.
 +
  
 
====Install application====
 
====Install application====
Line 24: Line 26:
  
 
Only '''1''' service script has been installed on your base SME Server in /etc/rc.d/init.d/ which is '''postgresql92-postgresql'''. This script will start and stop the installed application.
 
Only '''1''' service script has been installed on your base SME Server in /etc/rc.d/init.d/ which is '''postgresql92-postgresql'''. This script will start and stop the installed application.
 +
  
 
====Test installed application====
 
====Test installed application====
Line 33: Line 36:
 
  scl enable postgresql92 'man postgresql92'
 
  scl enable postgresql92 'man postgresql92'
 
press 'q' to leave the man page
 
press 'q' to leave the man page
 +
  
 
====Initialize database====
 
====Initialize database====
 
PostgreSQL requires the initialization of t's database environment. This can be done by the following command:
 
PostgreSQL requires the initialization of t's database environment. This can be done by the following command:
 
  service postgresql92-postgresql initdb
 
  service postgresql92-postgresql initdb
 +
  
 
===Start/Stop the application===
 
===Start/Stop the application===
Line 44: Line 49:
 
  /etc/rc.d/init.d/postgresql92-postgres start
 
  /etc/rc.d/init.d/postgresql92-postgres start
  
====Start/Stop PostgreSQL as a system Service====
+
 
 +
====Start/Stop PostgreSQL as a system service====
 
TBA
 
TBA
  
  
 
[[Category:Software Collections]]
 
[[Category:Software Collections]]

Revision as of 16:06, 6 January 2015

Warning.png Work in Progress:
This page is a Work in Progress. The contents off this page may be in flux, please have a look at this page history the to see list of changes.


Important.png Note:
Software Collections is only available for SME Server 9, 64-bit!


Postgresql.png

Installing and running PostgreSQL via Software collections

Software Collections has been introduced by Redhat as a safe way to run selective applications on Redhat based distributions in an isolated environment (separate directory), thus not effecting the base installation of the OS. This provides the possibility to e.g. test an application, install a higher version then the version installed by the base system (e.g. PHP), or temporarily use an application.

Software Collections applications can be started at boot as a system service, manually or in a specific shell.

PostgreSQL

Installation

To be able to install an application from the Software Collections, one must install software collections first. Please see Software collections on how to install this.


Required repository

After installing Software Collections, the scl repository for PostgreSQL has to added to the yum repositories. Please see here on how the enable the scl-postgresql92 repository.


Install application

After installing the scl-postgresql92 repository, PostgreSQL can be installed by issuing the following command:

yum install postgresql92 --enablrepo=scl-postgresql

Once installed, the application is installed on your SME Server at /opt/rh/postgresql92 as an isolated environment for the application.

Only 1 service script has been installed on your base SME Server in /etc/rc.d/init.d/ which is postgresql92-postgresql. This script will start and stop the installed application.


Test installed application

Once PostgreSQL has been installed, you can check if it is correctly installed by issuing:

scl -l

which will provide you a listing of all applications that are available on your system installed via Software Collections.

A simple man page about the installed application is now available via:

scl enable postgresql92 'man postgresql92'

press 'q' to leave the man page


Initialize database

PostgreSQL requires the initialization of t's database environment. This can be done by the following command:

service postgresql92-postgresql initdb


Start/Stop the application

PostgreSQL is now installed and initialized, and can be started and stopped via:

/etc/rc.d/init.d/postgresql92-postgres start

and

/etc/rc.d/init.d/postgresql92-postgres start


Start/Stop PostgreSQL as a system service

TBA