JPiere 8.2をインストールした

少し検証が必要になったので、オープンソースERPのJPiereを手元のPC(Windows 10)にインストールしてみました。

JPiereは、グローバルで公開されているiDempiereの日本商習慣対応ディストリビューションということで、現時点での最新版であるJPiere8.2は、こちらのサイトで配布されています。(JPiere7.1~8.2の配布&インストールガイドのページです。)

Windows 10環境といっても、実際にJPiereを本番環境で使うことになったらLinux環境になると思うので、VirtualBox上にCentOS7環境を作り、そこに導入します。

ちなみに、CentOS7にしたのは、本番環境として使用される可能性が高いAmazon Linux 2に類似のためです。

CentOS7環境の準備

最近、やっとWindows上でHyper-VとVirtualBoxの共存ができるようになったので、CentOS7環境はVirualBox上に作ります。とはいっても、Vagrantを使うので、操作が必要なのは僅かです。

vagrant init generic/centos7

Vagrantfileができるので、後でJPiereのWeb UIにアクセスできるようにネットワーク設定をしておきます。
IPアドレスは適当に指定してください。

# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.100"

あとは、vagrant upして、しばらく待てばCentOS7環境が出来上がります。

vagrant sshでCentOS7環境にログインしたら、下記の設定をしておきます。

sudo yum update
sudo localectl LANG=ja_JP.utf8
sudo timedatectl set-timezone Asia/Tokyo
sudo systemctl stop firewalld
sudo systemctl disable firewalld

firewalldの停止はローカル環境で特に不要だからです。インターネット上で公開されているサーバであれば、停止せずに適宜、設定してください。

Javaのインストール

Java11をインストールします。今回はOpenJDKを使用します。

sudo yum install java-11-openjdk

PostgreSQLのインストール

JPiereではデータベースとして、PostgreSQLかOracleを使用する必要があり、今回はPostgreSQL 11を使います。

sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql11-server
sudo systemctl enable postgresql-11
sudo systemctl start postgresql-11

引き続き、PostgreSQLの設定を行います。

# rootユーザで
passwd postgres

su - postgres # postgresユーザになる
/usr/pgsql-11/bin/initdb --encoding=UTF8 --no-locale --pgdata=/var/lib/pgsql/11/data --auth=trust
psql -U postgres -c "CREATE ROLE adempiere SUPERUSER LOGIN PASSWORD 'adempiere'"
createdb --template=template0 -E UNICODE -O adempiere -U adempiere idempiere
psql -d idempiere -U adempiere -c "ALTER ROLE adempiere SET search_path TO adempiere, pg_catalog"

JPiereダンプファイルのインポート

PostgreSQLにJPiereのダンプファイルをインポートします。

ダンプファイルは、こちらからダウンロードできます。

ExpPat.jarをダウンロードします。Jarファイルといっても結局はZip圧縮されているだけなので、適当なZipツールで展開し、ExpPat.dmpを取り出します。

引き続き、postgresユーザで下記を実行します。

psql -d idempiere -U adempiere -f ExpDat.dmp

JPiereのインストール

JPiereのパッケージは先ほどのダンプファイルと同じ、こちらからダウンロードします。

Linux版であるJPiereServer82.Linux.x86_64.zipをダウンロードします。

今回は、/usr/local配下にインストールするため、下記のようにします。

sudo su -

# 必要に応じてunzipをインストールする
yum install unzip

cp JPiereServer82.Linux.x86_64.zip /usr/local
cd /usr/local
unzip JPiereServer82.Linux.x86_64.zip
cd jpiere-server

chmod +x idempiere
sh console-setup.sh

これでコンソール版のインストーラーが起動します。いくつか設定項目が対話型で聞かれるので、以下のように答えます。

Java Home [/usr/lib/jvm/java-11-openjdk-11.0.10.0.9-0.el7_9.x86_64]:
iDempiere Home [/usr/local/jpiere-server]:
Key Store Password [myPassword]:
(ON) Common Name [root]:
(OU) Organization Unit [iDempiereUser]:
(O) Organization [root]:
(L) Locale/Town [MyTown]:
(S) State []:
(C) Country (2 Char) [JP]
Application Server Host Name [0.0.0.0]:
Application Server Web Port [8080]:
Application Server SSL Port[8443]:
DB Already Exists?(Y/N) [N]:
y
1. Oracle
2. PostgreSQL
Database Type [2]
2
Database Server Host Name [localhost]:
Database Server Port [5432]:
Database Name[idempiere]:
Database user [adempiere]:
Database Password [adempiere]:
(パスワードを入力)
Database System User Password []
(postgresユーザのパスワードを入力)
testPort[127.0.0.1, 5432]
Mail Server Host Name [localhost]:
Mail User Login []:
Mail User Password []
Administrator EMail []:
Save changes (Y/N) [Y]:

インストールが完了すると、BUILD SUCCESSFULと表示されます。

JPiereの起動とログイン

JPiereの起動は下記のコマンドで行います。

sh idempiere-server.sh &

しばらくメッセージが流れるのを待って、Webブラウザからhttp://192.168.33.100:8080/webuiを開きます。IPアドレスはVagrantfileで最初に設定したIPアドレスです。

ログイン画面が表示されます。初期ユーザ情報は、下記のとおりです。

メール:[email protected]
パスワード:System

このような画面が表示されれば、ログイン完了です。

JPiereの終了

JPiereを終了させるには、Telnetで操作する必要があります。

telnet
telnet> open localhost 12612
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
osgi> close

この記事を書いた人

井上 研一

株式会社ビビンコ代表取締役、ITエンジニア/経済産業省推進資格ITコーディネータ。AI・IoTに強いITコーディネータとして活動。2018年、株式会社ビビンコを北九州市に創業。IoTソリューションの開発・導入や、画像認識モデルを活用したアプリの開発などを行っている。近著に「使ってわかった AWSのAI」、「ワトソンで体感する人工知能」。日本全国でセミナー・研修講師としての登壇も多数。