在網上查找了好多wiki,對國際化的支持,最后選擇了moinmoin,以下是搭建過程:
1. 安裝Python2.3.4版本
解壓縮Python2.3.4包后,進入解壓后的目錄:
#./configure --enable-unicode=ucs4
#make
#make install
2. 安裝moinmoin
解壓縮moin安裝包后,進入解壓后的目錄:
#python2.3 setup.py --quiet install --record=install.log
3. 建立一個wiki實例
#export PREFIX=/usr/local
#export SHARE=$PREFIX/share/moin
#export WIKILOCATION=$SHARE
#export INSTANCE=moin.cgi
#export USER=apache
#export GROUP=apache
#cd $WIKILOCATION
#mkdir $INSTANCE
#cp -R $SHARE/data $INSTANCE
#cp -R $SHARE/underlay $INSTANCE
#cp $SHARE/config/wikiconfig.py $INSTANCE
#chown -R $USER.$GROUP $INSTANCE
#chmod -R ug+rwX $INSTANCE
#chmod -R o-rwx $INSTANCE
#cd $WIKILOCATION/$INSTANCE
#mkdir cgi-bin
#cp $SHARE/server/moin.cgi cgi-bin
#chown -R $USER.$GROUP cgi-bin
#chmod -R ug+rx cgi-bin
#chmod -R o-rwx cgi-bin
#vi cgi-bin/moin.cgi
修改第一行為:#!/usr/local/bin/python2.3
增加如下內容:
import sys
sys.path.insert(0, '/usr/local/share/moin/moin.cgi')
#echo "" >>/etc/httpd/conf/httpd.conf
#echo "Alias /wiki/ \"$SHARE/htdocs/\"" >>/etc/httpd/conf/httpd.conf
#echo "ScriptAlias /mywiki \"$WIKILOCATION/$INSTANCE/cgi-bin/moin.cgi\"" >>/etc/httpd/conf/httpd.conf
#echo "Alias /wikiattach/ \"/usr/local/share/moin/moin.cgi/data/pages/\"">>/etc/httpd/conf/httpd.conf
3. 修改wiki的配置文件wikiconfig.py
sitename = u'SoftBrain Wiki'
logo_string = sitename
interwikiname = None
data_dir = '../data/'
data_underlay_dir = '../underlay/'
url_prefix = '/wiki'
allowed_actions = ['DeletePage', 'AttachFile', 'RenamePage']
attachments = {
'dir': '../data/pages',
'url': '/wikiattach',
}
acl_enabled = 1
acl_rights_default = 'All:read'
acl_rights_before = "liu chunping,zhaowm,zhangcg,wenyp,xiajx,fuxw,chenjing,chu,shichida:read,write,delete,revert,admin"
mail_smarthost = "192.168.99.2"
mail_from = "xiajx@hotmail.com"
mail_login = ""
navi_bar = [
# Will use page_front_page, (default FrontPage)
u'%(page_front_page)s',
u'RecentChanges',
u'FindPage',
u'HelpContents',
]
theme_default = 'modern'
charset = "utf-8"
upperletters = "A-Z"
lowerletters = "0-9a-z"
default_lang = 'zh'
page_category_regex = u'^Category[A-Z]'
page_dict_regex = u'[a-z]Dict$'
page_form_regex = u'[a-z]Form$'
page_group_regex = u'[a-z]Group$'
page_template_regex = u'[a-z]Template$'
show_hosts = 1
show_section_numbers = 0
chart_options = {'width': 600, 'height': 300}
4. 修改/usr/local/lib/python2.3/site-packages/MoinMoin/i18n目錄下的zh.py文件(大概在59-64行),
糾正編輯時候的javascript錯誤,做如下修改:
'''您對'%(lock_page)s'的編輯鎖定已經超時!''',
'''您對'%(lock_page)s'的鎖定將在#分鐘內失效.''',
'''您對'%(lock_page)s'的鎖定將在#秒內失效.''',
注意:對于moinmoin的遷移則不用進行步驟3、4,直接把原來的mywiki整個目錄拷貝到/usr/local/share/moin目錄即可;
如果需要單獨對某頁進行權限控制,只需要管理員在編輯該頁時,將以下內容添加到第一行即可:
#acl Trusted:read,write,delete,revert Known:read,write,delete,revert All:read