Linux9/Linux ES3上安装MoinMoin
2012-04-09 15:13 idkkk 阅读(805) 评论(0) 编辑 收藏 举报公司最近准备做信息共享,此任务交予我来搞定,我自然而然就想到了使用Wiki,由于Wiki良好的开发性及共享性,而且本身就是为了共用的写作目的而产生的,实在是不二之选。在众多Wiki之间来回比较,最终选择了MoinMoin,这个来自于德国人开发的Wiki,基于GNU GPL协议。该文主要记录下在Linux ES3下如何安装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
4) 配置Wiki
4.1) 修改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.2 ) 修改/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