2007年7月16日月曜日

OpenPNE on Gentoo Linux 2007.0 - その3 - OpenPNE 準備

では OpenPNE のファイルをコピーしていきます。
以下を実行します。
cd /usr/local/src
cp -r OpenPNE-2.8RC2 /var/www/localhost/htdocs/
cd /var/www/localhost/htdocs/OpenPNE-2.8RC2
chmod -R 0777 var/*
mv public_html ../
cd ../
mv public_html pne
cd OpenPNE-2.8RC2
cp config.php.sample config.php

ファイル"/var/www/localhost/htdocs/OpenPNE-2.8RC2/config.php"を編集します。
7行目の
define('OPENPNE_URL', 'http://sns.example.com/');

define('OPENPNE_URL', 'http://192.168.1.2/pne/');
に変更し、
13行目の
    'username' => '',

    'username' => 'root',
に変更し、
16行目の
    'database' => '',

    'database' => 'sns',
に変更し、
22行目の
define('ENCRYPT_KEY', '');
を適当に
define('ENCRYPT_KEY', 'abcdefg');
のように変更します。
また、"/var/www/localhost/htdocs/pne/config.inc.php"の7行目の
define('OPENPNE_DIR', realpath('../'));

define('OPENPNE_DIR', realpath('../OpenPNE-2.8RC2'));
に変更します。

次はデータベースの構築です。
以下を実行します。
cd /usr/local/src/OpenPNE-2.8RC2/setup/sql/mysql41/install
mysql
CREATE DATABASE `sns` DEFAULT CHARACTER SET utf8;
exit;
mysql -p --default-character-set=utf8 sns < install-2.8-create_tables.sql
mysql -p --default-character-set=utf8 sns < install-2.8-insert_data.sql
cd ../option
mysql -p --default-character-set=utf8 sns < pnebiz-header.sql

cron設定をします。
以下を実行します。
cd /var/www/localhost/htdocs/OpenPNE-2.8RC2
chmod 0755 bin/*.cron

ファイル"/etc/crontab"に以下の行を追加します。
00   6 * * * root sh
/var/www/localhost/htdocs/OpenPNE-2.8RC2/bin/tool_send_dairy_news.cron
/var/www/localhost/htdocs/OpenPNE-2.8RC2/bin/ /usr/bin/php
00   6 * * * root sh
/var/www/localhost/htdocs/OpenPNE-2.8RC2/bin/tool_send_birthday_mail.cron
/var/www/localhost/htdocs/OpenPNE-2.8RC2/bin/ /usr/bin/php
00   6 * * * root sh
/var/www/localhost/htdocs/OpenPNE-2.8RC2/bin/tool_send_schedule_mail.cron
/var/www/localhost/htdocs/OpenPNE-2.8RC2/bin/ /usr/bin/php
*/20 * * * * root sh
/var/www/localhost/htdocs/OpenPNE-2.8RC2/bin/tool_rss_cache.cron
/var/www/localhost/htdocs/OpenPNE-2.8RC2/bin/ /usr/bin/php

最後にウェブブラウザから
http://192.168.1.2/pne/?m=setup
にアクセスし、支持に従い初期設定を行います。
なお、
http://192.168.1.2/pne/?m=admin
にアクセスすることで管理設定が可能です。

もし、OpenPNE を社内LAN上に設置し、
しかも OpenPNE からお知らせ等のメールが届くようにしたいなら、
"/etc/ssmtp/ssmtp.conf"の
mailhub=mail
の行を
mailhub=192.168.1.100
のようにしておきます。
なお、"192.168.1.100"は社内のメール送信サーバです。

あとは好きに使ってみてください。

0 件のコメント:

コメントを投稿