OpenBravo 2.4 を CentOS にインストールする手順
概要
このガイドは、著者が検証した手順に基づき、CentOS 系の環境に OpenBravo ERP 2.4 を手動でインストールする方法を示します。主に次のコンポーネントを手動で配置し、インストーラを利用して OpenBravo をセットアップします。
- Apache Tomcat 5.5(/opt/tomcat)
- Apache Ant 1.7(/opt/ant)
- OpenBravo 2.4 インストーラ
- PostgreSQL(今回はインストーラからDBを指定)
重要: 本手順は検証済の OpenBravo 2.4 向けです。新しいバージョン(例: 2.5)は未検証のため、自己責任で試してください。
目次
- Apache Tomcat 5.5 の取得と起動
- Apache Ant 1.7 の取得と設定
- OpenBravo 2.4 のダウンロードとインストール
- 動作確認
- 事前チェックリスト
- トラブルシューティングとロールバック手順
- 受け入れ基準とテストケース
- ロール別チェックリスト
- 用語集
- 参考リンク
Apache Tomcat 5.5 の取得と起動
次の手順で Tomcat を /opt 配下にダウンロードして配置します。
cd /optwget http://apache.cyberuse.com/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.tar.gztar xzf apache-tomcat-5.5.27.tar.gzmv apache-tomcat-5.5.27 tomcatTomcat を起動してバックグラウンドに渡します。
/opt/tomcat/bin/startup.sh &システム起動時に自動起動させたい場合は rc.local に追記します。
echo "/opt/tomcat/bin/startup.sh &" >> /etc/rc.local重要: システムや配布元によっては init/systemd スクリプトを用意する方が望ましく、rc.local への追記は古い方法です。
Apache Ant 1.7 の取得と設定
Ant を手動で /opt に展開し、環境変数を設定します。
cd /optwget http://apache.promopeddler.com/ant/binaries/apache-ant-1.7.1-bin.tar.gztar xzf apache-ant-1.7.1-bin.tar.gzmv apache-ant-1.7.1 antecho "export ANT_HOME=/opt/ant" >> /etc/rc.localexport ANT_HOME=/opt/ant注: 永続的に環境変数を設定する場合は /etc/profile.d/ にスクリプトを置く方法が推奨されます。
OpenBravo 2.4 のダウンロードとインストール
/tmp に移動してインストーラを取得します。
cd /tmpwget http://surfnet.dl.sourceforge.net/sourceforge/openbravo/OpenbravoERP_2.40-linux-installer.bin実行権を付与してインストーラを実行します。
chmod +x OpenbravoERP_2.40-linux-installer.bin./OpenbravoERP_2.40-linux-installer.binインストーラはテキストベースで対話的に設定を行います。以下は対話例(推奨入力)です。インストール中に表示されるライセンスは ENTER を数回押して読み進め、最後に yes を入力します。
テキストプロンプトの一例(対話中の質問と推奨入力):
Please specify the directory where Openbravo ERP will be installed
[/opt/OpenbravoERP]: <– ENTER
Please specify a directory for the Openbravo ERP attachments
[/opt/OpenbravoERP/AppsOpenbravo/attachments]: <– ENTER
Installation mode
Please select the installation mode you wish to perform
[1] Complete
The database and the application server in the same computer
[2] Distributed
The database and the application server in different computers
Please choose an option [1] : <– ENTER
Please select the installation type you wish to perform
[1] Standard
Installs the database and sets up the application server.
Recommended.
[2] Development
Installs the database and and sets up the application server
through a compilation process.
Recommended for developers.
Please choose an option [1] : <– ENTER
Please specify the directory where the JDK is located
[/opt/java]: <– ENTER
Please specify the location where the Ant executable is located
[/opt/ant/bin/ant]: <– ENTER
Please specify the directory where Tomcat is located.
In case of having Tomcat split into 2 directories, select the one containing the webapps directory
[/opt/tomcat]: <– ENTER
Please select a database
[1] PostgreSQL
[2] Oracle
Please choose an option [1] : <– ENTER
Please specify the directory where the binaries of the PostgreSQL installation are located (psql, pg_restore, vacuumdb)
[/usr/bin]: <– ENTER
Please enter the IP address of the PostgreSQL database
Database host [localhost]: <– ENTER
Please enter the port of the PostgreSQL database
Database port [5432]: <– ENTER
Enter the password for your “postgres” administrator user
Password : <– testpassword
Retype password : <– testpassword
Please enter the name of the PostgreSQL database
Database name [openbravo]: <– ENTER
Please enter a username for the Openbravo ERP PostgreSQL database
Username [tad]: <– admin
Please enter a password for the new database user
Password : <– adminpassword
Retype password : <– adminpassword
Enter a context name.
This is used in the URL to access Openbravo ERP:
http://
Context name [openbravo]: <– openbravoerp
Please select the preferred date and time formats
Date format
[1] DD MM YYYY
[2] MM DD YYYY
[3] YYYY MM DD
Please choose an option [1] : <– ENTER
Date separator
[1] -
[2] /
[3] .
[4] :
Please choose an option [2] : <– ENTER
Time format
[1] 12h
[2] 24h
Please choose an option [2] : <– ENTER
Time separator
[1] :
[2] .
Please choose an option [1] : <– ENTER
Should the installer populate the database with demo data?
[Y/n]: Y <– ENTER
Setup is now ready to begin installing Openbravo ERP on your computer.
Do you want to continue? [Y/n]: Y <– ENTER
インストールは数分かかります。完了すると “Setup has finished installing Openbravo ERP on your computer.” のようなメッセージが表示されます。
動作確認
インストールが成功したらブラウザで次の URL にアクセスします(ホスト名/IP とコンテキスト名はインストール時の設定に合わせる)。
初回ログイン: ユーザー名 Openbravo、パスワード openbravo を使用します(インストール時に変更している場合はその値)。
注意: スクリーンショットは割愛しています。問題がある場合は後述のトラブルシューティングを参照してください。
事前チェックリスト
- Java JDK がインストール済みであること(インストールパスを把握している)。
- /opt に書き込み可能であること(root または適切な権限)。
- PostgreSQL がインストール済み、または同一ホストにインストール可能であること。
- firewall や SELinux の設定でポート 8080(または Tomcat のポート)が許可されていること。
受け入れ基準
- ブラウザで Openbravo のログイン画面が表示されること。
- 管理者アカウントでログインできること。
- デフォルトのデモデータが正しくロードされていること(インストールでデモデータを選択した場合)。
- アプリケーションログ(Tomcat の catalina.out)に重大な例外が出ていないこと。
テストケース(簡易)
- 起動テスト: Tomcat 起動後、/openbravoerp にアクセスして 200 OK を確認する。
- ログインテスト: Openbravo 管理者でログインできるか。
- データベース接続: PostgreSQL に接続でき、Openbravo 用のスキーマが存在するか。
- アップロードテスト: 添付ファイル機能にファイルをアップロードして取り出せるか。
トラブルシューティング(よくある問題と対策)
- Tomcat が起動しない
- /opt/tomcat/logs/catalina.out を確認。Java のバージョン不整合やポート競合をチェック。
- Ant が見つからない
- インストール時に指定した Ant のパス(/opt/ant/bin/ant)を再確認。PATH に追加する。
- PostgreSQL 接続エラー
- psql が /usr/bin にあるか確認。インストーラで指定したホスト/ポート/ユーザーの権限を確認。
- インストールが途中で失敗する
- ログ出力を確認し、一時ディレクトリの空き容量やファイルパーミッションをチェック。
重要: SELinux が有効な場合、Tomcat からのファイルアクセスやポート利用が制限されることがあります。問題が発生したら一時的に permissive にするか、適切なポリシーを追加してください。
ロール別チェックリスト
- システム管理者
- JDK/Ant/Tomcat のインストールとバージョン確認
- 必要なポートを firewall で開放
- サービスの自動起動設定
- データベース管理者
- PostgreSQL ユーザーと権限の作成
- バックアップとリストア手順の確認
- 開発者
- 開発モードでのビルド手順確認(必要ならソースからビルド)
- Ant のビルドスクリプトをレビュー
インシデント時の簡易実行手順(ロールバック)
- アプリケーション停止:
/opt/tomcat/bin/shutdown.sh- データベースのバックアップがあればリストア。なければ重要データを抽出して保存。
- /opt/OpenbravoERP ディレクトリをリネームまたは削除(削除前にバックアップ必須)。
mv /opt/OpenbravoERP /opt/OpenbravoERP.bak- Tomcat 内の Openbravo webapp を削除または置換。
rm -rf /opt/tomcat/webapps/openbravo- 必要ならインストーラ前の状態(Ant/Tomcat のみ残す)に戻して再インストール。
ミニメソドロジー(推奨手順)
- テスト環境で一度インストール手順を通す。
- 構成をドキュメント化(パス、ユーザー、パスワード、ポート)。
- 本番ではスクリプト化・自動化された手順で反復可能にする。
用語集(1 行)
- Tomcat: Java Servlet/JSP を実行するウェブアプリケーションサーバ。
- Ant: Java ビルドツール。OpenBravo のコンパイルやデプロイで使用。
- コンテキスト名: OpenBravo をアクセスする URL の一部(例: /openbravoerp)。
セキュリティ注意点
- デフォルトの管理者パスワードは必ず変更すること。
- インターネットに公開する場合は SSL/TLS(HTTPS)を導入し、通信を暗号化すること。
- PostgreSQL の管理アカウント(postgres)のパスワードを強力に設定すること。
参考リンク
- Openbravo: http://www.openbravo.com/
- CentOS: http://www.centos.org
- PostgreSQL RPM リポジトリ: http://yum.pgsqlrpms.org
まとめ: この手順では Tomcat と Ant を /opt 配下に手動で配置し、OpenBravo のインストーラを使って 2.4 をセットアップする方法を示しました。事前チェックとログ確認、役割別の確認項目を用意しているので、まずはテスト環境で一通り試してから本番適用してください。