CentOS5.5にMoinMoinをインストールしたメモ 

ちょっと前にJamWikiを使い始めたというエントリを書いたけど
すぐやめてMoinMoinにうつった。


MoinMoinにうつった理由

  • データベースではなくテキストファイルでデータを保存する
  • リビジョン管理が便利そう
  • もいんもいんって変な名前だな、と思った。

変な名前だけど海外では割とメジャーらしい。


MoinMoin(サーバー版)を使うには

が必要です。


以下、インストール&設定メモ
OSはCentOS5.5
MoinMoinのバージョンは1.9.3


まずはソースを取ってくる
http://moinmo.in/MoinMoinDownload

# wget http://static.moinmo.in/files/moin-1.9.3.tar.gz
# tar zxvf moin-1.9.3.tar.gz


moin-1.9.3/docs/INSTALL.html
を見ながらインストールすすめる。
ぶっちゃけ全部書いてある。


まずApachepython-develが必要なので入れる。

yum -y install httpd
yum -y install httpd-devel
yum -y install python-devel


mod_wsgiが必要なので入れる
http://code.google.com/p/modwsgi/

# wget http://modwsgi.googlecode.com/files/mod_wsgi-3.2.tar.gz
# tar zxvf mod_wsgi-3.2.tar.gz
# cd mod_wsgi-3.2
# ./configure --with-apxs=/usr/sbin/apxs --with-python=/usr/bin/python
# make
# make install
# make clean


Apacheの設定
/etc/httpd/conf/httpd.conf に次の行を加える。

LoadModule wsgi_module modules/mod_wsgi.so


MoinMoinのインストール

# cd moin-1.9.3
# python setup.py install --force --record=install.log

/usr/share 以下にインストールされる


次はMoinMoinの設定
/usr/share/moin/server/moin.wsgi に次の記述を追加

sys.path.insert(0, '/usr/share/')
sys.path.insert(0, '/usr/share/moin/config')


/usr/share/moin/config/wikiconfig.py に次の記述を追加

instance_dir = '/usr/share/moin'
interwikiname = u'toshi\'s Wiki'
sitename = u'toshi\'s Wiki'


apacheにmoin.wsgiを登録する
http://localhost/wikiでMoinMoinにアクセスできるようにした。

WSGIScriptAlias /wiki/ "/usr/share/moin/server/moin.wsgi"


apache再起動

# apachectl restart


この状態で
http://localhost/wiki
にアクセスするとエラーになる。
data_dirとunderlay_dirの権限の設定が必要らしい。
apacheユーザ&グループが読み書き実行をできるようにする。

chown -R apache:apache /usr/share/moin/data
chown -R apache:apache /usr/share/moin/data/pages
chmod 770 /usr/share/moin/data
chmod -R 770 /usr/share/moin/data/pages

chown -R apache:apache /usr/share/moin/underlay
chmod -R 770 /usr/share/moin/underlay

ここでつまづいた。
権限設定を言われた通りにしてもエラーが治らない。
どうやらSELinuxががんばってたようだ。無効にしといた。


このままだと画像ファイルとかがないので見た目がなんか変。
staticファイルを持ってくる。
#なぜsetup.pyで画像ファイルもインストールしてくれないんだろうか?

# cp -r /usr/lib/python2.4/site-packages/MoinMoin/web/static/ /usr/share/moin/server/moin_static193


staticファイル群のパスの設定。
wikiconfig.pyを再びちょっと編集。

url_prefix_static = '/wiki' + url_prefix_static


これで見た目もきれいになる。
あとは画面から言語設定とかをすればOK
。。。結構めんどかったな。


以上。