Q's WebDiaryはシンプルなWeb日記帳です。
アーカイブのpublic/以下のファイルは,public_html/などに置いて外部に公開するファイルです。
以下では,ユーザー名がfoo, ホームディレクトリが/home/foo, Webサーバーの公開ディレクトリが/home/foo/public_htmlでhttp://hostname/~foo/の場合を想定します。
/opt$ tar xzvf diary-2.0.0.tar.gz
/opt/diary-2.0.0$ ruby pathsetup.rb [Rubyのパス]
pathsetup.rbの引数を省略した場合は,内部でwhich rubyします。
/opt/diary-2.0.0$ cp public/diary* ~/public_html ~/public_html$ mv dot.htaccess .htaccess
閲覧,投稿できる人を制限する場合は,Webサーバーの認証を設定します。.htaccessファイルを次のように書き換えます。
AddHandler cgi-script .cgi .rb <Files ".*"> deny from all </Files> <Files diary-edit.cgi> AuthType Basic AuthName diary AuthUserFile /home/foo/wwwdata/htpwd Require user foo </Files>
deny from allで.htaccessファイルが外部から見えないようにしておきます。
AuthUserFile命令は,ユーザー名とパスワードが書かれたファイルの名前を設定します。Require命令はアクセスを許すユーザーを設定します。
/home/foo/wwwdata/htpwdファイルの内容は次のようになります。
foo:xuhbSD7.OAq0U
パスワードファイルの生成はhtpasswdコマンドを用います。詳しくはApache HTTP Server Version 1.3 Documentationなどを参照してください。
ユーザーを追加する場合は,.htaccessファイルとパスワードファイルの両方に追加する必要があります。
データディレクトリの設定などは,diary-conf.rbで行います。
DIARY_DATA_DIR = "/home/foo/wwwdata/diary"
データはpublic_htmlの外に置くようにします。/home/foo/wwwdata/diaryのパーミッションは707 (rwx---rwx) にします。
Copyright (c) 2001 HORIKAWA Hisashi.
All rights reserved.
Netsphere Laboratories