首页 文章

在Debian Wheezy上设置MoinMoin的问题

提问于
浏览
1

我在Debian Wheezy上设置一个MoinMoin wiki时遇到问题 . 我想要的是 localhost/MyWiki 的wiki(实际上我并不在乎它的确切位置) . 我遵循了三个不同的安装指南:Debian软件包的官方README.Debian,MoinMoin Installation Guide for DebianOz123's install notes,都无济于事 .

这是我的设置说明(抱歉长度,但由于配置不是微不足道,我认为我最好具体):

1) Create and populate /var/www/mywiki:

# mkdir /var/www/mywiki
# mkdir /var/lib/mywiki
# cp -r /usr/share/moin/data /usr/share/moin/underlay /var/lib/mywiki

2) Pass on the wiki to Apache:

# chown -R www-data: /var/www/mywiki /var/lib/mywiki

3) Configure Apache2:

将以下内容添加为 /etc/apache2/sites-available/mywiki

<VirtualHost *:80>
    # NOTE: I changed the server name "wiki.example.org" to:
    ServerName localhost
    DocumentRoot /var/www/mywiki/
    Alias /moin_static194/applets/FCKeditor/ "/usr/share/fckeditor/"
    Alias /moin_static194/ "/usr/share/moin/htdocs/"
    ScriptAlias /MyWiki "/usr/share/moin/server/moin.cgi"
</VirtualHost>

4) Configure MoinMoin:

编辑 /etc/moin/mywiki.py 以包含这些行(注意:安装 python-moinmoin 后, /etc/moin 不包含名为 mywiki.py 的文件,因此我首先搜索复制它:

# cp $(find /usr/share/moin/ | grep -E "/mywiki\.py$") /etc/moin/

然后我添加/更改了文件以包含以下行:

sitename = u'MyWiki' # [Unicode]
    data_dir = '/var/lib/mywiki/data'
    data_underlay_dir = '/var/lib/mywiki/underlay'
    superuser = [u"YourName", ]

然后我将 www-data localhost 附加到 /etc/moin/wikilist

echo "www-data localhost" > /etc/moin/wikilist

5) Activate wiki:

# a2ensite mywiki
# service apache2 reload

6) Visit your new wiki at http://your.site/MyWiki/LanguageSetup then create you account (name according to the superuser you specified above).

但是,访问 http://localhost/MyWiki/LanguageSetup 会出现以下错误:

ConfigurationError

ImportError: No module named wikiconfig

Check that the file is in the same directory as the server script. If it is
not, you must add the path of the directory where the file is located to the
python path in the server script. See the comments at the top of the server
script.

Check that the configuration file name is either "wikiconfig.py" or the
module name specified in the wikis list in farmconfig.py. Note that the
module name does not include the ".py" suffix.

所以我搜索 wikiconfig.py

# find /usr/share/moin/ | grep -E "/wikiconfig\.py$"
... /usr/share/moin/config/wikiconfig.py

通过 wikiconfig.py 读取,我发现该文件应该与 data/underlay/ 位于同一个目录中 . 由于我在步骤1中将两个dir复制到 /var/lib/mywiki ,我也在那里复制了这个脚本:

# cp $(find /usr/share/moin/ | grep -E "/wikiconfig\.py$") /var/lib/mywiki

我还将 sitename = u'Untitled Wiki' 更改为 sitename = u'MyWiki' 以匹配 mywiki.py 中的配置(步骤4) . 仍然,访问 http://localhost/MyWiki/LanguageSetup 给出了另一个错误:

ConfigurationError

data_dir "/usr/share/moin/server/data" does not exist, or has incorrect ownership or
permissions.

Make sure the directory and the subdirectory "pages" are owned by the web
server and are readable, writable and executable by the web server user and
group.

It is recommended to use absolute paths and not relative paths. Check
also the spelling of the directory name.

为什么脚本试图在 /usr/share/moin/server/data 中找到 data 而不是 /var/lib/mywiki/data ,因为我在 mywiki.py 中配置了它(参见步骤4)?我试图让MoinMoin运行更多时间,我很想承认,我想知道你们中的一个人是否可以指出我方式中的明显错误......

1 回答

  • 0

    你似乎想要以debian包的方式做到这一点:

    安装debian包(apt-get install python-moinmoin左右)

    然后维基农场配置在/etc/moin/*.py中,因为debian将它们放在那里 - 仔细编辑它们,但是不要删除farmconfig.py(因为debian设置是一个wiki服务器场配置,你可以从1个wiki开始然后添加更多wiki) .

    debian应该有适配器脚本(比如moin.cgi或moin.wsgi)将'/ etc / moin'插入到sys.path中(sys.path是python搜索代码的地方) - 检查一下,你得到的错误消息说它没有找不到wikiconfig.py(这是在找不到farmconfig.py之后尝试的第二件事)

    您的印象是wikiconfig.py必须与数据和底层错误相同 . 它只需要在sys.path中的目录中 .

    顺便说一下,如果你没有使用apache进行第一步,你可以从http://moinmo.in/下载存档,解压缩并运行./wikiserver.py它就可以了 .

相关问题