ここでは、サーバにLinuxOSをお使いになる場合のDenbun POP版のインストール方法を説明いたします。
インストールをはじめる前に、
動作環境
をご確認ください。
アンインストールするには、
こちら をご参照ください。
※インストール作業の前に、本製品ホームページより、「Denbun POP版 Linux対応版」のモジュールをダウンロードし、インストールするサーバーにFTP転送してください。
→
Denbun POP版 Linux対応版 のダウンロードはこちら
Denbun のインストールでは、以下の作業を行っていただく必要があります。
1.dnpwmlユーザーの作成
2.Denbunプログラムのインストール
3.Denbunデータベースの復元
4.textsearch-jaの設定
5.Apacheの設定調整
6.動作確認
1.と、3.は、PostgreSQLの管理ユーザー(ここではpostgresとします。)で作業を行ないます。それ以降は原則として特権ユーザー(root)で行ないます。
- 1.Denbunユーザーの作成
-
psqlコマンドにてPostgreSQLのユーザーにdnpwmlユーザーを作成します。
[root@xxxxxx ~]# su - postgres
[postgres@xxxxxx ~]$ psql -d template1 -c \
> "CREATE USER dnpwml WITH PASSWORD 'dnpwml' CREATEUSER"
CREATE ROLE
|
- 2.Denbunプログラムのインストール
-
FTP転送したファイルからパッケージソースを展開します。この例ではFTP転送したファイルが/home/guestにあるものとします。
ここでは、作業用ディレクトリとして/tmpを使用します。
※この作業は「root」ユーザーで行ってください。
[root@xxxxxx postgres]# cd /tmp
[root@xxxxxx tmp]# tar xvzf /home/guest/dnpwmlV30PR10lR9pg83.tar.gz
|
展開が終了すると、/tmp下にdnpwmlというディレクトリが作成されます。
展開された /tmp/dnpwmlディレクトリの所有者を、Apacheの実行ユーザーに変更します。
この例では、ユーザー:apache、グループ:apacheです。
[root@xxxxxx tmp]# chown -R apache:apache /tmp/dnpwml
|
まず、Denbunの静的コンテンツを、Apacheのドキュメントルートに移動します。
この例では、/var/www/htmlとなっています。
Denbunの静的コンテンツは、次の1つです。
@ dnpwmlrootディレクトリ(GIFイメージファイル群, Javaスクリプト群)
これらのディレクトリは、展開されたdnpwmlディレクトリにあります。
[root@xxxxxx tmp]# mv /tmp/dnpwml/dnpwmlroot /var/www/html
|
次に、dnpwmlディレクトリ自体を、ApacheのCGIディレクトリに移動します。
この例では、/var/www/cgi-binとなっています。
[root@xxxxxx tmp]# mv /tmp/dnpwml /var/www/cgi-bin
|
- 3.Denbunデータベースの復元
-
インストールしたDenbunプログラム内のデータベースファイル(dnpwmldb.pgdmp)からpg_restoreコマンドにてDenbunデータベースを復元します。データベースファイルは、インストールプログラム内に含まれていますので/var/www/cgi-bin/dnpwml/admintools/dbfileに存在します。
※この作業は、「postgres」ユーザーで行ってください。
[postgres@xxxxxx ~]$ pg_restore -C -Fc -d template1 \
> /var/www/cgi-bin/dnpwml/admintools/dbfile/dnpwmldb.pgdmp
|
※ PostgreSQLのユーザーにpostgresが存在しない場合に、リストアを行うと「ERROR: role " postgres" does not exist」というエラーが表示されますが、特に問題ありません。
- 4.textsearch-jaの設定
-
復元したDenbunデータベースにtextsearch-jaを設定します。textsearch-jaに必要なSQLは、インストールプログラム内に含まれていますので/var/www/cgi-bin/dnpwml/admintools/sqlに存在します。
※この作業は、「postgres」ユーザーで行ってください。
設定し直すため、既にデーターベースにあるtextsearch-jaをアンインストールします。
[postgres@xxxxxx ~]$ psql -U dnpwml -d dnpwmldb < /var/www/cgi-bin/dnpwml/admintools
/sql/uninstall_textsearch_ja.sql
|
※ 以下4つのエラーが表示されますが、特に問題有りません。
「ERROR: text search configuration "pg_catalog.japanese" does not exist」
「ERROR: text search parser "pg_catalog.japanese" does not exist」
「ERROR: text search dictionary "japanese_stem" does not exist」
「ERROR: text search template "pg_catalog.mecab" does not exist」
データーベースにtextsearch_jaをインストールします。
[postgres@xxxxxx ~]$ psql -U dnpwml -d dnpwmldb < /var/www/cgi-bin/dnpwml/admintools
/sql/textsearch_ja.sql
|
Denbunからtextsearch_jaを使用するための設定を行います。
[postgres@xxxxxx ~]$ psql -U dnpwml -d dnpwmldb < /var/www/cgi-bin/dnpwml/admintools
/sql/denbun_ja.sql
|
- 5.Apacheの設定調整
-
ここで行なう、Apacheの設定調整とは次の1つとなります。
@ Denbun,PostgreSQL環境変数の設定
これらの設定は、Apacheのコンフィグレーションファイル(httpd.conf)にて設定します。コンフィグレーションファイルは、Redhat Enterprise Linux 同梱のApacheの場合 /etc/httpd/confにありますので、Viなどのエディタで編集します。
SetEnvディレクティブを追加します。追加する位置は最終行で結構です。
[root@xxxxxx tmp]# vi /etc/httpd/conf/httpd.conf
・
・(中略)
・
#Denbun POP, PostgreSQL Library Path
SetEnv LD_LIBRARY_PATH /var/www/cgi-bin/dnpwml/lib
|
コンフィグレーションファイルの設定が終了したら、コンフィグのチェックを行ないます。問題なければ、Apacheを再起動します。
[root@xxxxxx ~]# /etc/rc.d/init.d/httpd configtest
Syntax OK
[root@xxxxxx ~]# /etc/rc.d/init.d/httpd restart
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]
[root@xxxxxx ~]#
|
以上で、Denbun POP版のインストールは完了です。
- アンインストールするには
-
rm コマンドを使用して、インストール先のディレクトリを削除します。
(rmコマンドの前に\(エンサイン)をつけると、削除確認を行わないで削除します。)
■Denbunプログラム(モバイル対応版)のアンインストール
モバイル対応版をインストールした場合、まず、Denbunプログラム(モバイル対応版)のメッセージファイルを、Denbunのメッセージディレクトリから削除します。この作業は特権ユーザー(root)で行ないます。
[guest@xxxxxx ~]$ su
パスワード:
[root@xxxxxx guest]# cd /var/www/cgi-bin/dnpwml/dnpwmllocal/ja
[root@xxxxxx ja]# \rm message.mobile
[root@xxxxxx ja]# \rm wmlmob
|
次に、Denbunプログラム(モバイル対応版)のディレクトリ自体を削除します。
[root@xxxxxx ja]# \rm -r /var/www/cgi-bin/dnpmwml
|
以上でDenbunプログラム(モバイル対応版)のアンインストールは終了です。
■Denbunプログラムのアンインストール
DenbunプログラムのディレクトリおよびDenbunの静的コンテンツのディレクトリを削除します。
[root@xxxxxx ~]# \rm -r /var/www/cgi-bin/dnpwml
[root@xxxxxx ~]# \rm -r /var/www/html/dnpwmlroot
|
■Denbunデータベース及びユーザーの削除
以下のコマンドを入力し、Denbun POP版のインストールで作成したPostgreSQLのデータベースとユーザーを削除します。
※この作業は「postgres」ユーザーで行ってください。
[root@xxxxxx ~]# su - postgres
[postgres@xxxxxx ~]$ dropdb dnpwmldb
[postgres@xxxxxx ~]$ dropuser dnpwml
|
■スケジューラー自動起動設定の削除
Denbun POP版のインストールで設定したスケジューラーの自動起動の設定を削除します。
※この作業は「root」ユーザーで行ってください。
[guest@xxxxxx ~]$ su
パスワード:
[root@xxxxxx guest]# export EDITOR vi
[root@xxxxxx guest]# crontab -u apache -e
|
apacheユーザーに設定されているcronの設定が表示されますので、「dnpscheduler.sh」の行を削除し、保存して終了してください。
例)
30 8 * * 1,2,3,4,5 /var/www/cgi-bin/dnpwml/dnpscheduler.sh
|
↑
この行をcronファイル内から削除してください。
以上で、Denbun POP版のアンインストールは完了です。