LoginSignup
1
4

More than 5 years have passed since last update.

AWSのCentos7上にJPiereを立ち上げる

Last updated at Posted at 2017-04-07

AWS上にJPiere(iDempiere)を構築する 忘却録

  • AWSインスタンスの作成
  • CentOS7の初期設定

AWS上にCentOS7 インスタンスを作成する

テスト的に作成するので、t2.small構成で作成しました。
セキュリティグループを作成する時に「全てのTCPトラフィックを許可する」「IPアドレス→My IP」として、緩いセキュリティながらもとりあえず安全な環境を作りました。

TeraTermでインスタンスに接続

インスタンス作成時のセキュリティキーを指定すればAWS上インスタンスに繋がります
単純なことですが、AWSインスタンスCentOS7 のデフォルトアカウント名は「centos」です。以前はEC2-userだったと思うので要注意です
私は、ログイン出来ずに多くの時間を費やしてしまいました

CentOS7の初期設定をザックリと

Update

$ sudo yum update

SELINUXの廃止

/etc/selinux/configに対して SELINUX=disabled
$ sudo yum install wget unzip vim

よく使うツールをインストール

$sudo yum install -y net-tools bind-utils NetworkManager-tui
$yum install bash-completion
$wget https://github.com/terralinux/systemd/raw/master/src/systemctl-bash-completion.sh -O /etc/bash_completion.d/systemctl-bash-completion.sh
$sudo localectl set-locale LANG=ja_JP.utf8
$sudo localectl set-keymap jp106
$sudo timedatectl set-timezone Asia/Tokyo

使わないサービスを停止

$sudosystemctl list-unit-files --type service | grep enabled
$sudo systemctl stop postfix
$sudo systemctl disable postfix

Javaをインストールします

今回はOpenJDK8を入れます
$sudo yum install java

Postgresql 9.4 をインストールします

JPiere4.1 はPostgresql9.4らしいので
$wget https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm
--2017-04-07 12:27:42-- https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm
  rpmはhttps://yum.postgresql.org/repopackages.php ここから探す
$sudo rpm -ivh pgdg-centos94-9.4-3.noarch.rpm
$sudo yum -y install postgresql94-server postgresql94-devel postgresql94-contrib

初期化します

$sudo su
$su - postgres
-bash-4.2$ cd /var/lib/pgsql/9.4
-bash-4.2$ rm -rf data
-bash-4.2$ /usr/pgsql-9.4/bin initdb --encoding=UTF8 --no-locale --pgdata=/var/lib/pgsql/9.4/data

自動起動させるようにします

$sudo systemctl enable postgresql-9.4
$sudo systemctl start postgresql-9.4

postgresqlのVersion確認

$sudo su - postgres
psql -version
psql
postgres-# select version();
postgres-# \q

Postgreユーザーのパスワード設定

 OSのpostgresアカウントとDBのpostgreアカウントがあるので双方パスワードの設定をします

postgres ユーザーのパスワード変更(Unix)

$ sudo passwd postgres

postgres ユーザーのパスワード変更(Postgresql)

$ su - postgres
-bash-4.2$ psql
psql (9.4.1)
Type "help" for help.

postgres=# \password postgres
Enter new password: ********
Enter it again: ********
postgres=# \q

postgresアクセス許可設定

pg_hba.conf編集

vim /var/lib/pgsql/9.4/data/pg_hba.conf
[...]
host all all 127.0.0.1/32 md5
host all postgres 0.0.0.0/0 md5 # add
[...]

postgresql.conf編集

vim /var/lib/pgsql/9.4/data/postgresql.conf
[...]
listen_addresses = '*'
[...]
port = 5432
[...]

postgresql再起動

$sudo systemctl restart postgresql-9.4

pgAdminⅢ のインストール

Postgresqlを管理するために Windows端末に pgAdminⅢをインストールしておく
インストール方法は割愛

pgAdminからの接続を試す

接続が出来ない場合、postgresqlの設定ファイルを再度確認してください
 F/Wの確認
 pg_hba.confの認証方法の確認

ログインロールの作成

名称:adempiere

DB作成

DB名称:idempiere
ここまでpgAdminで実施します

JPiereの入手とインストール

OSDNからJPiere関連ファイルを入手(ExpDat.dmpももらっておく)
$cd /usr/local/etc
$wget https://ja.osdn.net/dl/jpiere/ExpDat.dmp
$wget idempiereServer.gtk.linux.x86_64.zip
$sudo unzip idempiereServer.gtk.linux.x86_64.zip

データベースのリストア

idmepiere-server/data/seedディレクトリに移動します。
Adempiere_pg.jarファイルを解凍します。
$ sudo chmod a+rwx ../seed
$ jar xvf Adempiere_pg.jar
$ psql -d idempiere -U adempiere -f Adempiere_pg.dmp

もしくは ExpDat.dmpのリストア
iDempiereのデータベースのリストア
$ psql -d idempiere -U adempiere -f ExpDat.dmp

alternatives --config java
インストールされているJavaの確認と どのJavaを使うか?の選択

JPiereの初期設定と起動

$ cd /usr/local/etc/idempiere***/idempiere-server
$ sudo sh console-setup.sh
各設定値を入力します
DBはlocalhostで。
$ sudo sh idempiere-server.sh &
起動します
DBに関してのエラーが出た場合 私は
$ sudo sign-database-build.sh を実行して直りました

日本語の設定

$sudo yum -y install ibus-kkc vlgothic-*
$sudo localectl set-locale LANG=ja_JP.UTF-8

動作確認

http://サーバー名:8080/webui
でアクセスできます。

1
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
4