Secure Installation of Postgresql
Updated: 10/22/2005
General Information
This guide will help you set up, and start running PostgreSQL using the ports tree. For information of how to use PostgreSQL, try google. This guide will not help you with PostgreSQL past installing it.Requirements
You will need the following items to be able to complete this guide:Compiling
This is where your up-to-date ports come in handy.|
# # |
cd /usr/ports/databases/postgresql80-server/ make install |
Setting up PostgreSQL
There is little to do for the PostrgreSQL set up, but these steps are required. You could go with the defaults in the rc script, but that leaves you open for attack from local untrusted users.|
# # # # |
mkdir /usr/local/pgsql/data chown pgsql:pgsql /usr/local/pgsql/data su -l pgsql -c "initdb -D /usr/local/pgsql/data -W -A md5" echo 'postgresql_enable="YES"' >> /etc/rc.conf |
Starting PostgreSQL
There are two ways that you can start PostgreSQL. Reboot your system, or execute it's rc file.| # | /usr/local/etc/rc.d/010.postgresql.sh start |
| # | ps auxwwww | grep postmaster |
Using PostgreSQL
Using PostgreSQL can be done one of two ways. One way is to install phpPgAdmin, which allows you to use a web interface to add users, add databases, and other such neat features, or one can make use of the psql tool that is available.| # | psql <dbname> <username> |
This guide is © 2005 - 2008 Bert JW Regeer.
Author: Bert JW Regeer
bsdguides at 0x58 dot com