1

我在 Debian Wheezy 上设置单个 MoinMoin wiki 时遇到问题。我想要的是一个维基localhost/MyWiki(实际上我不在乎它到底在哪里)。我遵循了三个不同的安装指南:Debian 软件包的官方 README.Debian、Debian 的MoinMoin 安装指南Oz123 的安装说明,都无济于事。

这是我的设置说明(对不起,因为配置不是微不足道的,我想我最好具体一点):

1)创建和填充/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) 将 wiki 传递给 Apache:

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

3)配置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)配置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) 激活维基:

# a2ensite mywiki
# service apache2 reload

6) 访问您的新 wiki,http://your.site/MyWiki/LanguageSetup然后创建您的帐户(名称根据您在上面指定的超级用户)。

但是,访问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/。由于我/var/lib/mywiki在步骤 1) 中将两个目录都复制到了,因此我也将这个脚本复制到了那里:

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

我还更改sitename = u'Untitled Wiki'为与(步骤 4)sitename = u'MyWiki'中的配置匹配。mywiki.py尽管如此,访问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.

为什么脚本试图找到data/usr/share/moin/server/data不是/var/lib/mywiki/data像我在其中配置的那样mywiki.py(参见步骤 4)?在尝试让 MoinMoin 运行比我愿意承认的次数更多之后,我想知道你们中的一个人是否可以指出我的方式中的明显错误......

4

1 回答 1

0

你似乎想用 debian 包的方式来做:

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

然后 wiki 场配置位于 /etc/moin/*.py 因为 debian 将它们放在那里 - 仔细编辑它们,但不要删除 farmconfig.py (因为 debian 设置是 wiki 场配置,您可以从 1 个 wiki 开始稍后添加更多 wiki)。

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

您认为 wikiconfig.py 必须与 data 和 underlay 位于同一目录中的印象是错误的。它只需要在 sys.path 的目录中。

顺便说一句,如果您不使用 debian 方式并且不使用 apache 作为您的第一个 moin 步骤,您可以从http://moinmo.in/下载存档,解压缩并运行 ./wikiserver.py 并它会起作用的。

于 2014-02-10T01:27:46.800 回答