ChatLuckのアップデートモジュールのインストール

ChatLuck (Linux+PostgreSQL) のアップデートモジュールのインストールについての説明です。

ご注意
アップデート作業を行う前に、必ずデータのバックアップを行ってください。
(データのバックアップ方法は以下をご覧ください。)
https://www.chatluck.com/download/doc/install/ja_JP/com/pg_backup_l.html

 

本手順では、以下のインストールを行います。

・本体/スマートフォン版モジュール
・データベースの更新
・「zip」コマンド(システム管理者設定機能の「ログファイルをダウンロード」で使用します)

1.各プロセスの停止

1-1. suコマンドにて、rootユーザーにスイッチしてください。

[guest@xxxxxx ~]$ su -

Password:

1-2. 以下のコマンドを実行し、リアルタイムサーバーを停止します。

[root@xxxxxx ~]# service chatluck stop

Stopping chatluck-rserver:          [ OK ]

"Stopping chatluck-rserver: [ OK ]"のように表示されれば停止されています。

1-3. 以下のコマンドを実行し、Redisサーバーを停止します。

[root@xxxxxx ~]# service redis stop

Stopping ...

Redis stopped

"Redis stopped"のように表示されれば停止されています。

1-4. 以下のコマンドを実行し、スケジューラーを停止します。

[root@xxxxxx ~]# pkill -9 -f chatBatScheduler

 

2.パッケージの展開

ここでは、ダウンロードしたファイルをFTPにて、"guest"ユーザーのホームディレクトリに転送済みとし、/tmpディレクトリを作業用ディレクトリとして使用する前提で説明します。
引き続き、"root"ユーザーで作業を行います。

2-1. /tmpディレクトリに、前回インストール時のファイルが残っている場合は削除します。

[root@xxxxxx ~]# cd /tmp

[root@xxxxxx tmp]# rm -rf cgi-bin htdocs contrib

 

2-2. 次に、/tmpディレクトリにパッケージを展開します。

[root@xxxxxx tmp]# tar zxvf /home/guest/chatluck-update-VxxRxxpg96lRE6.tar.gz

展開が完了すると、tmpディレクトリ下に「cgi-bin」、「htdocs」ディレクトリが作成されます。

 

2-3.展開された「cgi-bin」、「htdocs」ディレクトリのオーナーをApacheのサービス実行ユーザーに変更します。

[root@xxxxxx tmp]# chown -R apache:apache cgi-bin htdocs

 

3.古いファイルの削除

引き続き、"root"ユーザーで作業を行います。

3-1. ChatLuck本体のインストール先から、不要なファイルを削除します。

[root@xxxxxx tmp]# rm -rf /var/www/cgi-bin/chatlk/rserver/node_modules

 

4.SQLの適用

4-1."root"ユーザーで、展開されたディレクトリ内に「sqlupd」の所有者を"postgres"ユーザーに変更します。

[root@xxxxxx tmp]# chown -R postgres:postgres cgi-bin/chatlk/sqlupd

4-2."postgres"ユーザーにスイッチし、「chatlkdb」の更新を行います。

[root@xxxxxx tmp]# su - postgres

[postgres@xxxxxx ~]$ cd /tmp/cgi-bin/chatlk/sqlupd/chatlkdb

[postgres@xxxxxx chatlkdb]$ ./install.sh chatlk localhost chatlkdb 5432

コマンドパラメータは以下の通りとなります。
./install.sh chatlk localhost chatlkdb 5432
       ①    ②   ③   ④

chatlk ・・・ PostgreSQL上のChatLuck用のロール名
localhost ・・・ PostgreSQLサーバーが動作しているサーバーのホスト名
chatlkdb ・・・ ChatLuckのDB名
5432 ・・・ PostgreSQLサーバーが動作しているポート番号
通常、ChatLuckをV3.0より前からご利用の方は5433、V3.0以降からご利用の方は5432となります。

4-3.続けて、"postgres"ユーザーで「chatladdb」の更新を行います。

[postgres@xxxxxx ~]$ cd ../chatladdb

[postgres@xxxxxx chatladdb]$ ./install.sh chatlk localhost chatladdb 5432

コマンドパラメータは以下の通りとなります。③以外は4-2と同様となります。
./install.sh chatlk localhost chatladdb 5432
       ①    ②   ③   ④

chatlk ・・・ PostgreSQL上のChatLuck用のロール名
localhost ・・・ PostgreSQLサーバーが動作しているサーバーのホスト名
chatlkdb ・・・ ChatLuckのログ保存用DB名
5432 ・・・ PostgreSQLサーバーが動作しているポート番号
通常、ChatLuckをV3.0より前からご利用の方は5433、V3.0以降からご利用の方は5432となります。

4-4.コマンドが正常に終了したら、exitコマンドにて、"root"ユーザーに戻してください。

[postgres@xxxxxx chatladdb]$ exit

[root@xxxxxx ~]# cd /tmp

 

5.パッケージの上書き

5-1.展開されたディレクトリ内に静的コンテンツを、WebサーバーのドキュメントルートにあるChatLuckのイメージディレクトリに上書きコピーします。

[root@xxxxxx tmp]# /bin/cp -rp htdocs/chatres /var/www/html/.

[root@xxxxxx tmp]# /bin/cp -rp htdocs/chatsares /var/www/html/.

5-2.展開された「chatlk」「chatlksa」ディレクトリ内のファイルとディレクトリを、ChatLuck本体のインストール先に上書きコピーします。

[root@xxxxxx tmp]# /bin/cp -rp cgi-bin/chatlk /var/www/cgi-bin/.

[root@xxxxxx tmp]# /bin/cp -rp cgi-bin/chatlksa /var/www/cgi-bin/.

5-3.不要ファイルの削除を行います。

[root@xxxxxx tmp]# rm -rf cgi-bin htdocs

 

6.リアルタイムサーバーの起動

引き続き、"root"ユーザーで作業を行います。

6-1. 以下のコマンドを実行し、Redisサーバーを起動します。

[root@xxxxxx ~]# service redis start

Starting Redis server...

"Starting Redis server..."のように表示されれば起動しています。

6-2. 以下のコマンドを実行し、リアルタイムサーバーを起動します。

[root@xxxxxx ~]# service chatluck start

Starting chatluck-rserver:

"Starting chatluck-rserver:"のように表示されれば、リアルタイムサーバーの起動は完了です。

 

7.「zip」コマンドのインストール

引き続き、"root"ユーザーで作業を行います。

7-1. 以下のコマンドを実行し、インストールします。

[root@xxxxxx ~]# yum install zip
読み込んだプラグイン:xxxxxxxx
 ・
 ・(中略)
 ・
インストール容量: xxx k
Is this ok [y/d/N]: y
Downloading packages:
 ・
 ・(中略)
 ・
完了しました!
[root@xxxxxx ~]# zip
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
 ・(後略)

zipコマンドが利用できれば、インストールは完了です。

 

以上でChatLuck (Linux+PostgreSQL版) アップデートモジュールのインストールは完了です。

 

記載の製品名および商品名は、各社の商標、または登録商標です。