安裝postgres & phppgadmin & Idempiere

Install postgres9.3

安裝 rmp
# cd /tmp
# wget http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
# rpm -Uvh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
# yum install pgdg-centos93-9.3-1.noarch.rpm

查可用的套件
# yum list postgres*

安裝
# yum install postgresql93-server postgresql93-contrib
啟動資料庫
# service postgresql-9.3 initdb

重開機自動啟動
# chkconfig postgresql-9.3 on

啟動
# service postgresql-9.3 start

設定 Postgre 密碼

1. # vi /var/lib/pgsql/9.3/data/postgresql.conf

#listen_addresses = 'localhost'
listen_addresses = 'localhost'

#port = 5432
port = 5432

2. # /etc/init.d/postgresql-9.3 stop
# vi /var/lib/pgsql/9.3/data/pg_hba.conf

Navigate down to the line that says
# "local" is for Unix domain socket connections only
# local all all peer/md5/indent
Edit it to
local all postgres trust

# /etc/init.d/postgresql-9.3 start

[root@server1 ~]# su root
[root@server1 ~]# sudo su - postgres
-bash-4.1$ psql -U postgres
psql (9.3.4)
Type "help" for help.

postgres=# alter user postgres with password '***********';
ALTER ROLE
postgres=# \q
-bash-4.1$ logout

# /etc/init.d/postgresql-9.3 restart

* 修改 /var/lib/pgsql/9.3/data/pg_hba.conf file & 設定PostgreSQL-Configure TCP/IP

By default, TCP/IP connection is disabled, so that the users from another computers can’t access postgresql. To allow to connect users from another computers, Edit file /var/lib/pgsql/9.3/data/postgresql.conf:
步驟按照 http://www.unixmen.com/install-postgresql-9-3-phppgadmin-centos-6-5/
# vi /var/lib/pgsql/9.3/data/pg_hba.conf
# vi /var/lib/pgsql/9.3/data/postgresql.conf


安裝 phpPgAdmin

http://www.server-world.info/en/note?os ... gresql&f=2



# yum install phpPgAdmin
# yum install php55w-pgsql
(php55w is dependency)

由於centos 6.5內建的phppgadmin版本尚未支援postgres-9.3,所以要修改:
下載phppgadmin 的master版本

https://github.com/xzilla/phppgadmin


複製 master版本database 中的connection.php & postgres.php檔案換貼至/usr/share/phpPgadmin/classes/database 中

phpPgAdmin bye default all allowed to access from localhost only. If you want to make it accessible from remote computers edit /etc/httpd/conf.d/phpPgAdmin.conf and update configure like below:
# vi /etc/httpd/conf.d/phpPgAdmin.conf

Alias /phpPgAdmin /usr/share/phpPgAdmin


<Location /phpPgAdmin>
Order deny,allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
# Allow from .example.com
</Location>

改為:
Alias /phpPgAdmin /usr/share/phpPgAdmin
Alias /phppgadmin /usr/share/phpPgAdmin
Alias /pgadmin /usr/share/phpPgAdmin
Alias /pg /usr/share/phpPgAdmin

<Location /phpPgAdmin>
Order deny,allow
# Deny from all
Allow from 127.0.0.1
Allow from all
Allow from ::1

</Location>

設定phppgadmin

http://www.server-world.info/en/note?os ... gresql&f=2



# vi /etc/phpPgAdmin/config.inc.php

$conf['servers'][0]['host'] = 'localhost';
$conf['extra_login_security'] = false;
$conf['owned_only'] = true;

# /etc/init.d/postgresql-9.3 restart
# /etc/init.d/httpd restart

安裝Idempiere

1. create user (role) = adempiere
# sudo su - postgres
-bash-4.1$ psql -U postgres -c "CREATE ROLE adempiere SUPERUSER LOGIN PASSWORD '***********'"
password: (type in postgres password)
CREATE ROLE
-bash-4.1$ exit

2. create database (db) = idempiere
# sudo su - postgres
$ createdb --template=template0 -E UNICODE -O adempiere -U adempiere idempiere
password: 輸入adempiere的密碼
$ psql -d idempiere -U adempiere
Password for user adempiere:
idempiere=# CREATE SCHEMA adempiere;
CREATE SCHEMA
idempiere=# ALTER ROLE adempiere SET search_path TO adempiere, pg_catalog;
ALTER ROLE
idempiere=# \q
-bash-4.1$ exit

3.安裝PostgreSQL的UUID:
[root@erp ~]# sudo su - postgres
-bash-4.1$ psql -d idempiere -U adempiere -c 'CREATE EXTENSION "uuid-ossp"'
Password for user adempiere:
CREATE EXTENSION
-bash-4.1$ exit

4. Install idempiere Server

在任何一個地方建立一個idempiere 檔案夾, 例如 /opt/idempiere

1) 下載 Daily Installers for Linux (64bits) at

http://www.idempiere.org/downloads


解壓縮後,將其中的全部檔案copy放入idempiere 檔案夾中

# cd /opt/idempiere
# chmod 775 *.sh
# sh setup.sh

進入安裝頁面,填寫資料 按test 無錯誤後(除了Database name 不會之外,其他都要有打勾),按save

2) 輸入資料庫種子(seed)資料
# cd /opt/idempiere/utils
# sh RUN_ImportIdempiere.sh

3) 啟動系統
# cd /opt/idempiere
# sh idempiere-server.sh
或是
# ./idempiere
4. 進入網頁

http://localhost:xxxx

( web port)

https://localhost:xxxx

(在安裝頁面所填的 ssl port)