Ubuntu Server 8.04にTritonnをインストール

MySQLを万全の体制に整えてから作業始めたんだけど、Tritonn入れるにはMySQLごと入れる必要があるみたい(?)なので結局
apt-get remove mysql
してからの作業になりました。


Tritonnのビルド方法 - qwik.jp/tritonn

基本的には上記URLで。
ただし、Mecabの辞書にはnaist-jdicを使用しました。


Mecab
wget http://nchc.dl.sourceforge.net/sourceforge/mecab/mecab-0.98pre3.tar.gz
tar xzvf mecab-0.98pre3.tar.gz
cd mecab-0.98pre3
./configure
make
sudo make install


naist-jdic
wget http://iij.dl.sourceforge.jp/naist-jdic/40117/mecab-naist-jdic-0.6.0-20090616pre3.tar.gz
tar xzvf mecab-naist-jdic-0.6.0-20090616pre3.tar.gz
cd mecab-naist-jdic-0.6.0-20090616pre3
./configure --with-charset=utf8
make
sudo make install


使用辞書の変更
sudo vim /usr/local/etc/mecabrc
dicdir = /usr/local/lib/mecab/dic/naist-jdic

参考:http://d.hatena.ne.jp/code46/20090531/p1


Senna
./configure --prefix=/usr
make
sudo make install


Toritonn


Tritonnはそのままだと、configure する時にライブラリが無いとか怒られるので、
sudo apt-get install ncurses-dev


通常のconfigureだと、どうも上手くいかない。
MySQL公式バイナリのconfigureオプションを付けてやらないと、色々面倒な事になるそうだ。

CC='gcc' CFLAGS='-g' CXX='gcc' CXXFLAGS='-g' LDFLAGS='' ASFLAGS='' ./configure '--prefix=/usr/local/mysql' '--localstatedir=/usr/local/mysql/data' '--libexecdir=/usr/local/mysql/bin' '--with-comment=MySQL Community Server (GPL)' '--with-server-suffix=' '--enable-thread-safe-client' '--enable-local-infile' '--enable-assembler' '--with-pic' '--with-fast-mutexes' '--with-client-ldflags=-static' '--with-mysqld-ldflags=-static' '--with-zlib-dir=bundled' '--with-big-tables' '--with-yassl' '--with-readline' '--with-archive-storage-engine' '--with-blackhole-storage-engine' '--with-ndbcluster' '--with-csv-storage-engine' '--with-example-storage-engine' '--with-federated-storage-engine' '--with-innodb' '--with-extra-charsets=all' '--with-senna' '--with-mecab'


make
sudo make install
echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf.d/tritonn.conf
ldconfig


groupadd mysql
useradd -g mysql mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql


cd /tritonn-1.0.10-mysql-5.0.51a/support-files
cp mysql.server /etc/init.d/tritonn
chmod +x /etc/init.d/tritonn
update-rc.d tritonn start 93 2 3 4 5 . stop 20 0 1 6 .
mkdir /var/lock/subsys
cp my-medium.cnf /etc/my.cnf
vim /etc/my.cnf

[mysqld]以下に追加
default-character-set=utf8
skip-character-set-client-handshake

/etc/init.d/tritonn start

show variables like "char%";
で、文字コードの確認

参考:http://d.hatena.ne.jp/takehikom/20080807/1218059835
  :http://d.hatena.ne.jp/hayori/20080508/1210210580