LoginSignup
3
0

More than 5 years have passed since last update.

Ubuntu Server 18.04 LTSにINTER-Mediator環境を構築する

Last updated at Posted at 2018-05-12

はじめに

LAMP環境が整っているUbuntu Server 18.04 LTSにINTER-Mediator環境を構築する。インターネットで公開する場合は、別途、セキュリティ設定をしてください。

前提条件

Ubuntu Serverを次の手順で構築している。LAMP環境が整っていないかたは、次を参考にしてください。

INTER-Mediatorのインストール

GitHubのリポジトリからINTER-Mediatorをダウンロードして設定する。

下準備

https://github.com/INTER-Mediator/INTER-Mediator にアクセス、『Clone or download』ボタンをクリックして、URLを取得する。

URL: https://github.com/INTER-Mediator/INTER-Mediator.git

スクリーンショット 2018-05-12 12.46.40.png

ダウンロード

Apacheのドキュメントルートに任意をディレクトリを作成し、そこへ移動する。
gitコマンドでINTER-Mediatorをダウンロードする。

$ sudo mkdir /var/www/html/mywebapp
$ sudo chown ladmin:ladmin /var/www/html/mywebapp
$ cd /var/www/html/mywebapp
$ git clone https://github.com/INTER-Mediator/INTER-Mediator.git

設定

サンプルを動作させて正常に動作するかチェックします。

サンプルのディレクトリ
http://サーバのIP/mywebapp/INTER-Mediator/samples/

スクリーンショット 2018-05-12 13.31.15.png

データベース別にサンプルが用意されているので、スクリプトを使って目的のデータベースを設定する

MariaDBの設定

『INTER-Mediator/dist-docs』に『sample_schema_mysql.txt』があるこちらが、MariaDB用のスキーマのテキストファイルです。こちらをコマンドを使って設定する。

$ cd /var/www/html/mywebapp/INTER-Mediator/dist-docs
$ sudo mysql -u root -p < sample_schema_mysql.txt

ソケットのディレクトリが違うので『INTER-Mediator/params.php』を編集する

/* PDO awares below:
 */
$dbDSN = 'mysql:host=localhost;dbname=test_db;charset=utf8mb4';
//$dbDSN = 'mysql:unix_socket=/tmp/mysql.sock;dbname=test_db;charset=utf8';
//$dbDSN = 'mysql:unix_socket=/tmp/mysql.sock;dbname=test_db;charset=utf8mb4';
$dbOption = array();

PostgreSQLの設定

『INTER-Mediator/dist-docs』に『sample_schema_pgsql.txt』がある。こちらが、PostgreSQL用のスキーマのテキストファイルです。こちらをコマンドを使って設定する。

$ cd /var/www/html/mywebapp/INTER-Mediator/dist-docs
$ sudo -s
$ su postgres
$ psql -c 'create database test_db;' -U postgres -h localhost
$ psql -U postgres -f sample_schema_pgsql.txt -h localhost test_db

postgresのパスワードを設定いない場合、root経由でpsqlコマンドを実行して、次のSQLからパスワードを設定する。

パスワードの設定例
$ sudo -s
$ su postgres
$ psql
alter user postgres with password 'パスワード';

SQLiteの設定

『INTER-Mediator/dist-docs』に『sample_schema_sqlite.txt』がある。こちらが、SQlite用のスキーマのテキストファイルです。こちらをコマンドを使って設定する。

『/var/db/im』に『/var/db/im/sample.sq3』を作成例
$ sudo mkdir -p /var/db/im
$ cd /var/www/html/mywebapp/INTER-Mediator/dist-docs
$ sudo sqlite3 /var/db/im/sample.sq3 < sample_schema_sqlite.txt
$ sudo chown www-data /var/db/im
$ sudo chown www-data /var/db/im/sample.sq3

リファレンス

3
0
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
3
0