MacOSX(Leopard)にfreshreaderを設置

MacOSX(Leopard)でfreshreaderを動作させるまでの記録
MacPortのApache2+PHP5を使うことで動作するようになりました。

MacPortsPHPを入れてみる

デフォルトの方がサポートが厚いような気がするので好みですが、
仕方ないのであきらめてMacPortsPHPを入れてみることにした。
MacPortsのPHP5はapacheまたはapache2入れないと変なところ入れるみたいなので、apache2から入れる。
なんかdependencyの設定が一部おかしいのか、同時インストールが許容されてないのか時々エラーが出た。

$ sudo port install apache2
Password:
...()...
$

ncurseswのインストールに失敗。/opt/local/var/macports/buildにゴミがあるので掃除

$ sudo port clean ncursesw
Password:
---> Cleaning ncursesw
$ sudo port clean apache2
---> Cleaning apache2
$

掃除できたら引き続きインストール

$ sudo port install apache2
Password:
...()...
###########################################################
# A startup item has been generated that will aid in
# starting apache2 with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
###########################################################
Warning: apache2 requests to install files outside the common directory structure!
--->  Installing apache2 2.2.8_0+darwin_9
--->  Activating apache2 2.2.8_0+darwin_9
--->  Cleaning apache2
$

launchctlコマンド叩けと言われたので素直に叩く。

$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
Password:
$

ようやくPHP5入れる。+apache2が肝

$ sudo port install php5 +apache2
...()...
Warning: php5 requests to install files outside the common directory structure!
--->  Installing php5 5.2.5_3+apache2+macosx

If this is your first install, you might want
cd /opt/local/apache2/modules
/opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so

* copy  /opt/local/etc/php.ini-dist to  /opt/local/etc/php.ini
--->  Activating php5 5.2.5_3+apache2+macosx
--->  Cleaning php5
$

一端apache2の設定ファイルを作成する。

$ cd /opt/local/apache2/conf
$ sudo cp httpd.conf.sample httpd.conf
$ sudo vi httpd.conf

mod_sslのエラーが出るので外す

#LoadModule ssl_module modules/mod_ssl.so

内にphpの設定を追加(ついでにcgiの設定を追加)

    AddHandler cgi-script .cgi
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

先ほどの指示に従ってapxsコマンドを叩く

$ cd /opt/local/apache2/modules
$ sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
Password:
[activating module `php5' in /opt/local/apache2/conf/httpd.conf]
$

先ほどの指示に従ってphp.iniを用意する。

$sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini

apache2の起動

sudo /opt/local/apache2/bin/apachectl start

ブラウザから確認。
/Library/WebServer/Documentsの内容だったら×
/etc/local/apache2/htdocsの内容だったらOK!
→OKでした。

freshreaderの確認

$ sudo vi /opt/local/etc/php.ini

zend_extensionの行を追加

zend_extension = /opt/local/apache2/htdocs/freshreader/ioncube/ioncube_loader_dar_5.2.so

apache2の再起動

sudo /opt/local/apache2/bin/apachectl restart

一昨日設置したfreshreaderを/opt/local/apache2/htdocsに移動しておいてアクセス!!

でっきたーー!