Home > Archives > 2006年11月08日

2006年11月08日

MoinMoinWiki を入れてみる

http://moinmoin.wikiwikiweb.de/ からダウンロード. いまのところリリースバージョンのアーカイブは moin-1.5.6.tar.gz らしい.アーカイブを解凍後 setup.py を実行してファイル群をインストール.(python-dev が必要とのこと)

 python -v setup.py --quiet install --record=install.log

install.log を見るかぎり主に /usr/share/moin/ と /usr/lib/pythonXX/site-packages/MoinMoin/ にファイルをコピーするらしい.次にインストールされているかのテスト.python 起動して MoinMoin を読ませる.

> python
Python 2.3.5 (#2, Sep 11 2005, 02:13:21)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MoinMoin
>>>

問題なければ良し.あったら python のライブラリのサーチパスがおかしいとか.

そしたらインスタンスの生成をする.

export PREFIX=/usr/                        # prefix
export SHARE=$PREFIX/share/moin            # installed directory
export WIKILOCATION=$SHARE                 # diretcory to which a new instance is created
export INSTANCE=mywiki                     # name of new wiki instance
export USER=www-data                       # username of http-serevr
export GROUP=www-data                      # grop of http-serevr
cd $WIKILOCATION
mkdir $INSTANCE                            # make a directory for this instance
cp -R $SHARE/data $INSTANCE                # copy template data directory
cp -R $SHARE/underlay $INSTANCE            # copy underlay data directory
cp $SHARE/config/wikiconfig.py $INSTANCE   # copy wiki configuration sample file
chown -R $USER.$GROUP $INSTANCE            # change owner
chmod -R ug+rwX $INSTANCE                  # USER.GROUP may read and write
chmod -R o-rwx $INSTANCE                   # everybody else is rejected
cd $WIKILOCATION/$INSTANCE
mkdir cgi-bin
cp $SHARE/server/moin.fcg cgi-bin
chown -R $USER.$GROUP cgi-bin
chmod -R ug+rx cgi-bin
chmod -R o-rwx cgi-bin

んで,インスタンスの cgi-bin の中の main.fcg を修正.wikiconfig.py へのパスを追加.

sys.path.insert(0, '..')

さらに,wikiconfig.py を修正.data_dir, data_underlay_dir を moin.fcg からの正しいパスにする.ついでに画像ファイルとかのURLのprefixを正しく設定(httpd の alias どおりに).言語は日本語に.Wiki の名前とかロゴとかの設定も wikiconfig.py でするらしいが後回し.

    data_dir = '../data/'
    data_underlay_dir = '../underlay/'
    url_prefix = '/moinmoin'
    language_default = 'ja'

あとは,http サーバのほうで alias の設定などをしておく.lighttpd 使うので /etc/lighttpd/lighttpd.conf の alias.url にエントリを追加して,fastcgi.server に FastCGI の設定を書いておく(プロセスは自動起動で).

alias.url= (
    "/moinmoin/" => "/usr/share/moin/htdocs/",
)
fastcgi.server = (  "/mywiki" =>
  (( "docroot"   => "/",
     "min-procs" => 2,
     "max-procs" => 2,
     # allocate successive port numbers for each process, starting with "port"
     "bin-path"  => "/usr/share/moin/mywiki/cgi-bin/moin.fcg",
     "host"      => "127.0.0.1",
     "port"      => 2200,
     "check-local" => "disable",
     "broken-scriptfilename" => "enable",
  ))
)

これで /mywiki でページがみれるようになっているはず.画像とか css がおかしかったら alias が正しくないのかも.

Home > Archives > 2006年11月08日

Search
Feeds

Page Top