建立群組與使用者
groupadd postgres
useradd -g postgres postgres
安裝RPM source安裝方式可參考這裡
rpm --import http://yum.pgsqlrpms.org/RPM-GPG-KEY-PGDG
rpm -ivh postgresql-libs-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh postgresql-debuginfo-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh postgresql-docs-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh postgresql-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh postgresql-devel-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh postgresql-server-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh postgresql-plperl-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh postgresql-plpython-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh postgresql-test-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh uuid-1.6.1-3.fc9.i386.rpm
rpm -ivh uuid-pgsql-1.6.1-3.fc9.i386.rpm
rpm -ivh postgresql-contrib-8.3.7-1PGDG.fc10.i386.rpm
rpm -ivh tcl-8.5.3-1.fc10.i386.rpm
rpm -ivh postgresql-pltcl-8.3.7-1PGDG.fc10.i386.rpm
---------------------------------------------------------------------------
初始化DB
service postgresql initdb -D /var/lib/pgsql/data -E UTF-8 --locale=zh_TW
修改設定檔
cd /var/lib/pgsql/data
vi postgresql.conf
listen_addresses = '*'
port=5432
vi pg_hba.conf
host all all 192.168.0.0/16 trust
修改iptables,開放5432 port連線
vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
service iptables restart
service postgresql start
ps auxww | grep ^postgres
設定開機時啟動
chkconfig postgresql on
沒有留言:
張貼留言