MIGRATED-PAGES‎ > ‎

Installing PostgreSQL on Linux Server(MIGRATED)

http://wavelet.asia/customer-portal/?p=7528

You shouldn't have to do this if you are using most of the popular linux distributions because PostgreSQL comes together with the linux distributions.

However, if PostgreSQL  does not come with the linux CD, or if you do not want to use the default PostgreSQL that comes with the distribution, you can always install your own PostgreSQL database engine...

 

# Download postgresql files (approx. 55 MB)

# wget ftp://ftp3.au.postgresql.org/postgresql/v7.4.6/postgresql-7.4.6.tar.gz

 

 

gunzip postgresql-7.4.6.tar.gz

tar xvf postgresql-7.4.6.tar

cd postgresql-7.4.6

./configure --with-openssl

gmake

gmake install

mkdir -p /usr/local/pgsql/data

 

 

# create the user postgres

 

chown postgres /usr/local/pgsql/data

su - postgres -c '/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data'

cd ..

 

 

###############################################

# c) FOR REDHAT 9.0, Fedor OR BELOW ONLY!

###############################################

# There's no need to download postgresql server.

# Just configure postgres start script so that it starts with -i option

# create the respective postgres user and databases

# configure the postgresql pg_hba.conf script

# To do this:

# 1) backup your original /etc/init.d/postgresql

cp postgresql postgresqlbak

# 2) edit '/etc/init.d/postgresql' to include the "-i" in front "-p" in following line.

$SU -l postgres -c "$PGENGINE/postmaster -p ${PGPORT} -D '${PGDATA}' ${PGOPTS} &" >> $PGLOG 2>&1 < /dev/null sleep 1

# 3) Try to differentiate the edited file with the backup file.

[root@alextan init.d]# diff postgresqlbak  postgresql

# Then you see the following output:

>$SU -l postgres -c "$PGENGINE/postmaster -p ${PGPORT} -D '${PGDATA}' ${PGOPTS} &" >> $PGLOG 2>&1 < /dev/null sleep 1

---

>$SU -l postgres -c "$PGENGINE/postmaster -i -p ${PGPORT} -D '${PGDATA}' ${PGOPTS} &" >> $PGLOG 2>&1 < /dev/null sleep 1

# 4) The jboss postgresql user must be a superuser in postgresql for it to access the database etc.

 

Comments