メールNamazu検索
一、ツールインストール
1、MHonarc
MhonarcはメールファイルからHTMLファイルに転換するツールである。
①、ダウンロード
②、インストール
#: tar vxfz MhonArc-2.6.16.tar.gz
#: cd MhonArc-2.6.16
#: perl install.me
#: perl Makefile.PL
#: make
#: make
③、参考サイト
2、Perl
①、ダウンロード
②、インストール
#: tar vxfz perl-5.8.8.tar.gz
#: cd perl-5.8.8
#: ./configure.gnu
#: make
#: make install
③、参考サイト
3、Apache
①、ダウンロード
②、インストール
#: tar vxfz httpd-2.2.4.tar.gz
#: cd httpd-2.2.4
#: ./configure
#: make
#: make install
③、参考サイト
4、Namazu
①、ダウンロード
②、インストール
#: tar vxfz namazu-2.0.17.tar.gz
#: cd namazu-2.0.17/File-MMagic
#: perl Makefile.PL
#: make
#: make install
#: cd ..
#: ./configure
#: make
#: make install
③、参考サイト
5、Kakasi
①、ダウンロード
②、インストール
#: tar kakasi-2.3.4.tar.gz
#: cd kakasi-2.3.4
#: ./configure
#: make
#: make install
③、参考サイト
6、Mharc
MharcはMHonArcの実例です。今回のメール検索構造基礎とします。
①、ダウンロード
②、インストール
#: tar vxfz mharc-0.7.3.tar.gz
#: cd mharc-0.7.3
#: perl install.pl
「
詳細出力」:
Looking for 'make' program... '/usr/bin/gmake'
Looking for 'tar' program... '/bin/tar'
Looking for 'cp' program... '/bin/cp'
Looking for 'mkdir' program... '/bin/mkdir'
Looking for 'pwd' program... '/bin/pwd'
Looking for 'mhonarc' program... '/usr/local/bin/mhonarc'
Looking for 'mknmz' program... '/usr/local/bin/mknmz'
Looking for 'namazu.cgi'... '/usr/local/libexec/namazu.cgi'
Looking for 'procmail' program... '/usr/bin/procmail'
Looking for 'formail' program... '/usr/bin/formail'
Looking for 'lockfile' program... '/usr/bin/lockfile'
Pathname to install mharc: /home/mailarch/archives
"/home/mailarch/archives" does not exist, create? ['y']
Copying files into "/home/mailarch/archives"...
Copying files into "/home/mailarch/archives/html"...
Copying files into "/home/mailarch/archives/cgi-bin"...
Determine MHonArc library path from '/usr/local/bin/mhonarc'... /
'/usr/local/lib/perl5/site_perl/5.6.1'
Root URL for archives
(You can set this later in lib/config.sh): /archives
Would you like to edit "lib/config.sh" with "vi"? ['y']
... [edit session not shown] ...
Would you like to edit "lib/lists.def" with "vi"? ['y']
... [edit session not shown] ...
You are using MHonArc v2.6.7
Applying configuration (this may take awhile)...
-----------------------------------------------------------------------
| Please read the mharc installation document to finish the installation
| process. A copy is located at:
| /home/mailarch/archives/doc/install.html
-----------------------------------------------------------------------
#: cd /home/mailarch/archives[カスタマ、後の配置必要]
#: make configure
#: make
#: crontab etc/crontab
#: make configure
#: ln -s ./etc/.htaccess
#: make help
#: make readmail
#: make enable
③、参考サイト
7、Text::Kakasi
①、ダウンロード
②、インストール
#: perl Makefile.PL
#: make
#: make install
③、参考サイト
二、機能ディレクトリ紹介
詳細は「http://www.mhonarc.org/mharc/doc」を参考します。
1、mbox
mboxディレクトリはWindowsのDBXメールから転換して来たMBOXメールの保存ディレクトリです。「ユーザは自分でアップロード必要です」。
2、html
htmlディレクトリはMHonarcにより転換して来たHTMLファイルの保存ディレクトリです。サブディレクトリindexはNAMAZUによって作成したインデックスを保存するディレクトリです。
3、etc
etcディレクトリは検索システムの主な配置ファイルディレクトリです。
4、lib
libディレクトリはMHonarcのResourceFile及び配置シェルを保存するディレクトリです。
5、cgi-bin
cgi-binディレクトリはCGIプログラムの配置ファイルとインデックス作成Templateファイル、Namazu配置ファイルを保存するファイルです。
6、bin
binディレクトリは検索システムの実行できるプログラムです。
三、配置設定
1、Mharc設定
①、.namazurcファイル
赤色のは変更必要な部分です。
Index
/home/test/html
Template /home/test/cgi-bin/template
Replace /home/test/html/ /mail/html/
Logging off
#Lang en
↓
Index /home/mailarch/archives/html/index
Template /home/mailarch/archives/cgi-bin/template.ja
Replace /home/mailarch/archives/html/ http://「サーバIPアドレス」/
Logging off
Lang ja_JP.SJIS
②、コマンド実行
mkdir /home/mailarch/archives/html/index
rm -fr /home/mailarch/archives/cgi-bin/template
cp -R /usr/local/share/namazu/template /home/mailarch/archives/cgi-bin/
cd /home/mailarch/archives/cgi-bin
mv ./template ./template.ja
③、mknmzrcファイル
赤色のは変更必要な部分です。
# $KAKASI = "no -ieuc -oeuc -w";
↓
$KAKASI = "module_kakasi -ieuc -oeuc -w";
# $WAKATI = $none;
↓
$WAKATI = $KAKASI;
④、lib/common.mrc
以下の配置オプションを追加する。
<DefineVar chop>
SEARCH-CGI
./cgi-bin/namazu.cgi
</DefineVar>
⑤、etc/crontab
以下のコマンドを追加する。
10 23 * * 1-7
/usr/bin/mhonarc -rcfile /home/mailarch/archives/lib/common.mrc -add -outdir /home/mailarch/archives/html /home/mailarch/archives/mbox/*
40 23 * * 1-7
/usr/local/bin/mknmz -O /home/mailarch/archives/html/index /home/mailarch/archives/html
備考:定期的なHTML転換とインデックス作成。「毎週の23時10と40分に行う」
2、Apache設定
Apache配置ファイルはhttpd.confです。
•
#DocumentRoot "/usr/local/apache2/htdocs"
↓
DocumentRoot "/home/mailarch/archives/html/"
•
<Directory "/usr/local/apache2/htdocs">
↓
<Directory "/home/mailarch/archives/html/">
•
#ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
↓
ScriptAlias /cgi-bin/ "/home/mailarch/archives/cgi-bin/"
•
<Directory "/usr/local/apache2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
↓
<Directory "/home/mailarch/archives/cgi-bin">
AllowOverride None
Options ExecCGI
Options None
Order allow,deny
Allow from all
</Directory>
•
#AddHandler cgi-script .cgi
↓
AddHandler cgi-script .cgi
備考:/home/mailarch/archivesパスはMHarcのインストールディレクトリです。
三、Windows側のMboxファイル作成
Windows側はdbxconvツールでMboxメールファイルを作成必要です。
1、
ダウンロード
2、
使い方