我在 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 运行比我愿意承认的次数更多之后,我想知道你们中的一个人是否可以指出我的方式中的明显错误......