Changes

From SME Server
Jump to navigationJump to search
added database location
Line 39: Line 39:  
  scl enable postgresql92 'man postgresql92'
 
  scl enable postgresql92 'man postgresql92'
 
press 'q' to leave the man page
 
press 'q' to leave the man page
 +
 +
 +
=== Database location ===
 +
By default postgresql stores it's data in the environment under /opt/rh/postgresql92. We want to a different location for the data, for we want to make sure the data is being backed up by the default backup mechanisms of SME Server. The chosen location is /home/e-smith/files/pgsql/data
 +
 +
To be able to do this, we need to create a file as described below, which is the postgresql way of settings variables:
 +
mkdir -p /opt/rh/postgresql92/root/etc/sysconfig/pgsql echo PGDATA=/home/e-smith/files/pgsql/data > /opt/rh/postgresql92/root/etc/sysconfig/pgsql/postgresql92-postgres
      Line 44: Line 51:  
PostgreSQL requires the initialization of the database environment. This can be done by the following command:
 
PostgreSQL requires the initialization of the database environment. This can be done by the following command:
 
  /etc/rc.d/init.d/postgresql92-postgresql initdb
 
  /etc/rc.d/init.d/postgresql92-postgresql initdb
 +
    
===Start/Stop PostgreSQL===
 
===Start/Stop PostgreSQL===
Line 72: Line 80:     
== TO DO ==
 
== TO DO ==
* Change the location of the postgresql databases to /home/e-smith/files so they get backed up by default.
   
* Re-direct PostgreSQL log file to /var/log/
 
* Re-direct PostgreSQL log file to /var/log/
  

Navigation menu