2015-08-22 (土) 12:28:33

OpenPNE on FreeBSD 7.1

OpenPNE http://www.openpne.jp/ は以下のようなサーバ環境で動作させることを想定しています。

Webサーバ 
 Apache を推奨 

PHP 
 PHP 4.3.3 以降 / 5.0.x / 5.1.x 
 PHP の mbstring 拡張モジュールを使用可能 
 PHP の XML 拡張モジュールを使用可能 
 PHP の PCRE 拡張モジュールを使用可能 (UTF-8 サポート) 
 PHP から GD ライブラリを使用可能 (JPEG/GIF/PNG サポート) 
 ImageMagick を使う場合でも必要となります
 PHP の mcrypt 拡張モジュールの使用を推奨 

データベースサーバ 
 MySQL 4.0 以降 (4.1 以降を推奨) 

メールサーバ (携帯からメール投稿する場合) 
 Postfix 2.1.x 以降を推奨 (Postfix 以外のメールサーバでも動作報告あり) 

Apache 22 + mysql

# portinstall www/apache22

インストールオプションでmysql にチェックしてみたが、その後のmysqlのインストールバージョンと異なったため、MySQLのインストールがエラーで停止。pkg_delete -f mysql-client-5.0.77 する必要があったので、チェックしない方がよかった・・・ ;(

/usr/local/etc/apache22/httpd.conf

# User home directories
Include etc/apache22/extra/httpd-userdir.conf
# apachectl restart

Apache on FreeBSD

PHP-5

#portinstall lang/php5

APACHE Build Apache module にチェックを入れてみる。

Fatal error: Call to undefined function ``mb_language()`` in /usr/home/openpne/config.php on line 406

portinstall converters/php5-mbstring
apachectr restart
エラーが発生しました。

DB Error: connect failed 
http://sns.example.com/

で、DB再制作

OpenPNE には標準のPHP & PHP-extensions の他に、php5-mbstring が必要

ns# portinstall converters/php5-mbstring

PHP on FreeBSD

MySQL

# portinstall databases/mysql51-client
# portinstall databases/mysql51-server

MySQL on FreeBSD

Postfix

# portinstall mail/postfix

で、ついでに、/etc/mail/aliases で、sns : root として newaliases しとく。

Postfix on FreeBSD

OpenPNE Setup

fileOpenPNE_Setup.html

公式サイトからOpenPNE-2.12.8.tar.gzをとってきて、/usr/home/において、

ns# tar xvfzp OpenPNE-2.12.8.tar.gz
ns# chown -R www:www OpenPNE-2.12.8
ns# cp config.php.sample config.php
ns# mv /usr/home/OpenPNE-2.12.8 /usr/home/OpenPNE

vi config.php

define('OPENPNE_URL', 'http://210.255.122.212/~OpenPNE/');

// DBサーバ設定
$GLOBALS['_OPENPNE_DSN_LIST']['main'] = array(
'dsn'  => array(
   'phptype'  => 'mysql',
   'username' => 'pne',
   'password' => 'xxxxxxxx',
   'hostspec' => 'localhost',
   'database' => 'PNE',
   'new_link' => false,
   ),
);

// DB暗号化キー(56バイト以内のASCII文字列)
define('ENCRYPT_KEY', '*********');

// メールサーバードメイン
// 携帯メール投稿の宛先などのドメイン名に使われる
define('MAIL_SERVER_DOMAIN', 'piano.smb.net');
ns# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.30-log FreeBSD port: mysql-server-5.1.30

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE `PNE` DEFAULT CHARACTER SET utf8;
Query OK, 1 row affected (0.00 sec)

mysql> use PNE
Database changed

mysql> grant all privileges on PNE.*
   -> to pne@localhost identified by 'xxxxxxxx';
Query OK, 0 rows affected (0.02 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

cd /usr/home/OpenPNE/setup/sql/mysql41/install
ns# mysql -u pne -p --default-character-set=utf8 PNE < install-2.12-create_tables.sql
Enter password:
ns# mysql -u pne -p --default-character-set=utf8 PNE < install-2.12-insert_data.sql
Enter password:
ns#

http://OpenPNE_URL/?m=setup へアクセスして、SNS名、初期登録メンバーを設定。

OP2.PNG

cron設定

# chmod 0755 /usr/home/OpenPNE/bin/*.cron
# 6時にメールを送信&20分毎にRSS更新
00   6 * * * root sh /usr/home/OpenPNE/bin/tool_send_daily_news.cron      OPENPNE_DIR/bin/ /usr/local/bin/php
00   6 * * * root sh /usr/home/OpenPNE/bin/tool_send_birthday_mail.cron  OPENPNE_DIR/bin/ /usr/local/bin/php
00   6 * * * root sh /usr/home/OpenPNE/bin/tool_send_schedule_mail.cron  OPENPNE_DIR/bin/ /usr/local/bin/php
*/20 * * * * root sh /usr/home/OpenPNE/bin/tool_rss_cache.cron /usr/home/OpenPNE/bin/ /usr/local/bin/php
00   6 * * * root sh /usr/home/OpenPNE/bin/tool_send_daily_news.cron  /usr/home/OpenPNE/bin/ /usr/local/bin/php | mail -s "daily news log" kuji@smb.net
 1003  10:06   tar xvfzp OpenPNE-2.14.1.1.tar.gz
 1004  10:06   ll
 1005  10:42   slogin www.smb.net
 1006  10:44   cd /usr/local/www/OpenPNE-2.14.1.1
 1007  10:44   ll
 1008  10:44   cp config.php config.php_blackcube_20150822
 1009  10:44   ll
 1010  10:45   cd ../
 1011  10:45   ll
 1012  10:45   chown -R www:www OpenPNE-2.14.1.1
 1013  10:48   mysql_upgrade -u root -p
 1014  11:42   cd /usr/local/www/OpenPNE-2.14.1.1/setup/sql/mysql41/install
 1015  11:42   ll
 1016  11:46   mysql -u pne2 -p --default-character-set=utf8 PNE2 < install-2.14-create_tables.sql
 1017  11:46   mysql -u pne2 -p --default-character-set=utf8 PNE2 < install-2.14-insert_data.sql
 1018  11:48   cd ../
 1019  11:48   ll
 1020  11:48   cd option/
 1021  11:48   ll
 1022  11:48   mysql -u pne2 -p --default-character-set=utf8 PNE2 < pnebiz-header.sql
 1023  11:58   apachectl restart
 1024  12:26   history

添付ファイル: fileOP2.PNG 632件 [詳細] fileOpenPNE_Setup.html 1075件 [詳細]

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-08-22 (土) 12:28:33