How to install tdiary-full-2.2.3.tar.gz 


 2010.April.25 

 From: http://www.tdiary.org/

 Down filename: tdiary-full-2.2.3.tar.gz(安定版) ( full set ) 

  入れた目的:
  2009年2月に、Vine 5 を入れた際に、tDiary のバックアップをなくした。
 新しく日記を付け直すのも 面倒だったので 1年以上 放っておいたら、
 ひょんな事から、rimnet の
  レンタルサーバーの中の DAMEX の中に 過去日記の殆どがバックアップされていた。
  ので、復活した。
 が、なにせ、1年ぶりなので、設定の仕方を完全に忘れていた。ので、その忘備録。


ruby が入っているか 確認 $ rpm -qa ruby > ruby-1.8.7.174-3vl5 $ ruby --version > ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-linux] apache が入っているか 確認 $ rpm -qa apache > apache-1.3.41-2vl5 $ /usr/sbin/httpd -v > Server version: Apache/1.3.41 (Unix) (Vine/Linux) > Server built: Aug 23 2008 20:25:32 apache が動いているか 確認 run level 3, 5 が on になっている必要がある。 $ /sbin/chkconfig --list | grep httpd > httpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off apache のテスト その1 下記の s-cgi.cgi をテキストファイルで作る。 #!/bin/sh # s-cgi.cgi echo content-type: text/html echo "" echo "<html> <body> " date echo "</body> </html> " $ su - # cd ~/public_html/httpd/cgi-bin/ # vi s-cgi.cgi # chmod +x s-cgi.cgi ブラウザで http://localhost/cgi-bin/s-cgi.cgi へアクセスして 時間の表示が見れれば O.K. apache のテスト その2 ブラウザで http://localhost:80/ にアクセスして、 テストページ このページは、Apacheウェブサーバが、......が表示されれたら O.K. Install インストールの仕方は、 ~/work/tar-ball/tdiary-2.2.3/doc/INSTALL.html と、 http://www.tdiary.org/doc/INSTALL.html に、書いてある。 $ cd ~ $ mkdir public_html $ cd ~/public_html $ ls -l public_html > drwxr-xr-x 5 jun1 jun1 4096 5月 4日 03:29 public_html/ $ tar xzvf tdiary-full-2.2.3.tar.gz $ mv tdiary-2.2.3 tdiary 日記の置き場 $ cd ~ $ chmod 755 lib $ cd lib $ mkdir tdiary $ su - # chown apache tdiary # chgrp apache tdiary # chmod 755 tdiary.............apache がアクセス出来ハズ?? $ la ~/lib/tdiary/* drwxr-xr-x 12 apache apache 4096 May 4 01:26 ./ drwxr-xr-x 8 jun1 jun1 4096 May 4 01:23 ../ drwxr-xr-x 2 apache apache 4096 Apr 26 00:45 2001/ drwxr-xr-x 2 apache apache 4096 Apr 26 00:43 2002/ drwxr-xr-x 2 apache apache 12288 Apr 26 00:43 2003/ drwxr-xr-x 2 apache apache 4096 May 3 23:44 2004/ drwxr-xr-x 2 apache apache 4096 Apr 26 00:44 2005/ drwxr-xr-x 2 apache apache 4096 Apr 4 04:18 2006/ drwxr-xr-x 2 apache apache 4096 May 4 01:26 2007/ drwxr-xr-x 2 apache apache 4096 May 4 01:26 2010/ drwxr-xr-x 4 apache apache 4096 May 4 01:26 cache/ drwxr-xr-x 2 apache apache 4096 May 4 01:26 category/ -rw-r--r-- 1 apache apache 6470 May 3 23:50 tdiary.conf -rw-r--r-- 1 apache apache 68 May 4 01:26 volatile.tdr ~/public_html/tdiary/tdiary.conf の編集 $ cd ~/public_html/tdiary $ cp tdiary.conf.beginner tdiary.conf $ gedit tdiary.conf > # @data_path = 'データを保存するディレクトリをここに指定' > @data_path = '/home/jun1/lib/tdiary' tdiary.conf は EUC だが、VINE-5 は UTF-8。 vi では tdiary.conf が文字化けして見れない CSRF攻撃対策に伴なって必要な利用者の対応 参考: http://www.tdiary.org/20050721.html $ gedit ~/public_html/tdiary/tdiary.conf に、下記を追加。 ------------------- # 2010 APRIL 25 # for CSRF # def base_url 'http://localhost/~jun1/tdiary/' end Wiki Style を はじめから使える様に なっていた $ cat ~/public_html/tdiary/tdiary.conf > @style = 'Wiki' .htpasswd の作成 $ cd ~ $ htpasswd -c /home/hoge/.htpasswd jun1 > New password: (小文字の1アリ) > Re-type new password: > Adding password for user jun1 ~/.htpasswd が作成される。 以降、認証を求められる時には、ここで指定した ID, PASSWD が必要となる。 .htaccessの作成 $ cd ~/public_html/tdiary/ $ cp dot.htaccess .htaccess $ vi .htaccess ---------------- Options +ExecCGI # if you run tDiary with symbolic link, use settings below. #Options +FollowSymLinks # if making anchor style as 'YYYYMMDD.html', add some settings below. # SEE header of html_anchor.rb plugin. AddHandler cgi-script .rb DirectoryIndex index.rb <files *.rhtml*=""> deny from all </files> <files tdiary.*=""> deny from all </files> <files update.rb=""> AuthName tDiary AuthType Basic # AuthUserFile /home/foo/.htpasswd AuthUserFile /home/jun1/.htpasswd <-----------追加 # Require user foo Require user jun1 <---------------------------追加 </files> /etc/httpd/conf/httpd.conf の修正 カレントの .htaccess の修正のみでは、うまく行かないので、こっちも、修正。 $ su - # cd /etc/httpd/conf/ # vi httpd.conf 下記を追加。 ----------------- # # For tDiary 2.2.3 # 2010.04.25 # <Directory "/home/*/public_html/tdiary"> Options +ExecCGI AddHandler cgi-script .rb .cgi Options FollowSymLinks ExecCGI DirectoryIndex index.rb </directory> <files *.rhtml=""> deny from all </files> <files tdiary.*=""> deny from all </files> <files update.rb=""> AuthName tDiary AuthType Basic AuthUserFile /home/jun1/.htpasswd Require user jun1 </files> ブラウザで http://localhost/~jun1/tdiary/ にアクセスして エラーが出なければ、成功。 CGIとしての squeeze.rb による、過去日記の日記の HTML化 参考: squeezeプラグイン $ cd ~/public_html/tdiary/ $ cp ~/public_html/tdiary/misc/plugin/squeeze.rb . $ chmod 755 ./squeeze.rb ブラウザで、 http://localhost/~jun1/tdiary/squeeze.rb へアクセスすると、 下記のメッセージが出て、 ~/lib/tdiary/cache/html/ 以下に、HTML ファイルが出来上がる。 > Squeeze for tDiary > > $Revision: 1.24 $ > > Copyright (C) 2002 MUTOH Masao > > Start! > > (2001/) 0921 0922 0923 0924 0925 > (中略) > (2007/) 0107 0109 0111 0114 0121 0127 0201 0210 0211 (2010/) 0425 0429 0503 > > End! 原因は、分からないけど、 {{isbn_image_right "B00006LPKY" }}を  無効(行頭にスペースを入れて)にしないと、下記のエラーが出て、ダメだった。 無効にしないでも大丈夫な場合もあって よく分からない。 とりあえず、一個一個、無効/有効を入れ替えて、大丈夫ではナイものだけ、無効にした。 > 500 Internal Server Error > #<rexml::parseexception: missing="" end="" tag="" for="" img="" (got="" th="" )=""> > Line: > Position: > Last 80 unconsumed characters: > <a href="?C=N;O=D">NameLast modified> > ... namazu インストール 予め、synaptic で namazu-cgi-2.0.18-2vl5 をインストールしておく事。 namazu 本体のインストール $ cd ~/public_html $ mkdir namazu $ cd namazu $ cp /var/www/cgi-bin/.namazurc . $ cp /var/www/cgi-bin/namazu.cgi . namazu 設定ファイル作成 $ cp .namazurc .namazurc.org $ vi .namazurc > # Index /usr/share/namazu/index > Index /home/jun1/lib/namazu > > Replace /home/jun1/lib/tdiary/cache/html/(\d\d\d\d)/ http://localhost/~jun1/tdiary/?date=\1 過去日記の検索用インデックスファイル作成 $ cd ~/lib/namazu/ $ mknmz /home/jun1/lib/tdiary/cache/html/ --output-dir=/home/jun1/lib/namazu/ > > 検索対象のファイルを調べています... > 842個のファイルがインデックス作成の対象として見つかりました > 1/842 - /home/jun1/lib/tdiary/cache/html/2001/0921 [text/html] > 2/842 - /home/jun1/lib/tdiary/cache/html/2001/0922 [text/html] > 3/842 - /home/jun1/lib/tdiary/cache/html/2001/0923 [text/html] > (中略) > 840/842 - /home/jun1/lib/tdiary/cache/html/2010/0425 [text/html] > 841/842 - /home/jun1/lib/tdiary/cache/html/2010/0429 [text/html] > 842/842 - /home/jun1/lib/tdiary/cache/html/2010/0503 [text/html] > インデックスを書き出しています... > [基本] > 日付: Tue May 4 02:20:08 2010 > 追加された文書の数: 842 > サイズ (bytes): 2,953,680 > 合計の文書数: 842 > 追加キーワード数: 30,897 > 合計キーワード数: 30,897 > わかち書き: module_kakasi -ieuc -oeuc -w > 経過時間 (秒): 31 > ファイル/秒: 27.16 > システム: linux > Perl: 5.010000 > Namazu: 2.0.18 ~/lib/namazu/ に、namazu index file( NMZ で始まるファイル )が沢山生成される。 euc なので、UTF-8 の Vine-5 では、下記の方法でないと、読めない。 $ td.nmz >& t.euc $ nkf -w -Lu t.euc > t.utf $ cat t.utf alias の設定 検索用インデックスファイルの更新をするアリアスを作成。 $ vi .bashrc > alias td.nmz='mknmz /home/jun1/lib/tdiary/cache/html --output-dir=/home/jun1/lib/namazu/' /etc/httpd/conf/httpd.conf の修正 これをしないと、apacheが namazu.cgi を CGI として認識しない。 その他の実行ファイルと勘違いする。 $ su - # cd /etc/httpd/conf # vi httpd.conf 下記を追加 ------------------------------ # # For squeeze.rb and serch_form.rb for namazu for tDiary 2.2.3 # 2010.May.04 # <Directory "/home/*/public_html/namazu"> Options +ExecCGI AddHandler cgi-script .cgi Options FollowSymLinks ExecCGI # DirectoryIndex index.html </directory> apache 再起動 # /etc/rc.d/init.d/httpd restart > httpdを停止中: [ OK ] > httpdを起動中: Processing config directory: /etc/httpd/conf.d/*.conf [ OK ] tDiary ヘッダ、フッタ ヘッダ <%= navi %> <h1><%= @html_title %></h1> <p>Categories | <%=category_list%> </p> <div class="main"> フッタ <%= navi %> </div> <div class="sidebar"> <div style="text-align: left"> <%=calendar2%> <%=calendar%> <div class="search"> <%= namazu_form( "../namazu/namazu.cgi","日記内検索","16","") %> </div> </div> <h3>最近の日記 <%= recent_list %> </div> 使用しているプラグイン ~/public_html/tdiary/misc/plugin/ に入っている * a.rb * amazon.rb * br.rb.................和田作成、 WiKi Style で改行を簡単に入れる為のプラグイン * calendar2.rb * category.rb * dbr.rb ................和田作成、 改行2行を 1つのプラグインで、 * dropdown_calendar.rb * edit_today.rb * footnote.rb * highlight.rb * image.rb * kw.rb * my-ex.rb * navi_user.rb * recent_list.rb * search_form.rb * squeeze.rb プラグインの 置き場所は、~/public_html/tdiary/misc/plugin/ br.rb プラグイン # 29 April, 2010 # br.rb Insert <br> tag in Wiki Style # Ref: http://shimoi.s26.xrea.com/ydiary/20030221.html#p01 # Ref: http://localhost/~jun1/tdiary/?date=20030223#p12 # def br() %Q[<br>] end dbr.rb プラグイン # 29 April, 2010 # br.rb Insert double <br> tag in Wiki Style # def dbr() %Q[<br><br>] end D A M E X 作り方の控えがナイ。ので、過去にどうやって作ったのか分からない。 rimnet に残っていたものをそのまま使用。 本体のインストール $ cd ~/public_html/ $ mkdir damex $ ls -la ~/public_html/ > drwxr-xr-x 7 jun1 jun1 4096 5月 6日 23:09 damex/ > drwxr-xr-x 2 jun1 jun1 4096 5月 4日 03:13 namazu/ > drwxr-xr-x 8 jun1 jun1 4096 5月 3日 23:04 tdiary/ $ ls -la ~/public_html/damex/ > drwxr-xr-x 4 jun1 jun1 4096 4月 4日 04:17 counter/ > drwxr-xr-x 2 jun1 jun1 16384 5月10日 01:11 data/ > -rw-r--r-- 1 jun1 jun1 817 5月 4日 17:25 frame.html > drwxr-xr-x 2 jun1 jun1 4096 4月 4日 04:17 images/ > -rw-r--r-- 1 jun1 jun1 1283 5月 6日 23:09 index.html > -rw-r--r-- 1 jun1 jun1 35071 5月 4日 17:55 intro.html > -rw-r--r-- 1 jun1 jun1 20364 5月 4日 17:56 menu.html > -rwxr-xr-x 1 jun1 jun1 6018 10月21日 2002 mon-mon.cgi* > drwxr-xr-x 2 jun1 jun1 4096 5月 4日 01:07 pics/ > -rwxr-xr-x 1 jun1 jun1 107 10月15日 2002 s-cgi.cgi* > -rwxr-xr-x 1 jun1 jun1 111 10月15日 2002 t.cgi* > -rw-r----- 1 jun1 jun1 0 3月29日 23:09 upgrade-log > drwxr-xr-x 3 jun1 jun1 4096 4月 4日 04:17 wwwcount/ httpd.conf の修正 $ su - # cd /etc/httpd/conf # vi httpd.conf 下記を追加 ----------------- # # For damex # 2010.May.04 # <Directory "/home/*/public_html/damex"> Options +ExecCGI AddHandler cgi-script .cgi Options FollowSymLinks ExecCGI DirectoryIndex index.html </directory> file 転送ソフト filezilla-3.3.2.1-3vl5 synaptic で 落としておく。  ホスト: ftp://ftp.yo.rim.or.jp ユーザー名: j_wada パスワード: (小文字の1入り) ポート: 21 他に、 lftp, ncftp, gftp
戻る