我在Debian上设置一个MoinMoin wiki有问题。我想要的是localhost/MyWiki的wiki (实际上我不在乎它在哪里)。我遵循了三种不同的安装指南: Debian包的官方README.Debian、Debian MoinMoin安装指南和奥兹123安装说明,都没有用。
下面是我的设置说明(很抱歉长度很长,但由于配置并不简单,我想我最好具体一点):
创建和填充/var/www/mywiki**:** 1)
# mkdir /var/www/mywiki
# mkdir /var/lib/mywiki
# cp -r /usr/share/moin/data /usr/share/moin/underlay /var/lib/mywiki2)将wiki传递给Apache:
# chown -R www-data: /var/www/mywiki /var/lib/mywiki3)配置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/wikilist5)激活wiki:
# a2ensite mywiki
# service apache2 reload6)访问您在http://your.site/MyWiki/LanguageSetup 的新wiki,然后创建您的帐户(根据您上面指定的超级用户的名称)。
但是,访问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/驻留在同一个dir中。由于我在步骤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中找到/usr/share/moin/server/data,而不是像我在mywiki.py (cf )中配置的那样在/var/lib/mywiki/data中找到它。第四步?我试过让MoinMoin跑更多次,但我想承认,我想知道你们中是否有人能指出我的方式中明显的错误.
发布于 2014-02-10 01:27:46
您似乎想用debian包的方式来实现它:
安装debian软件包(apt-get安装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搜索代码的地方)--检查一下,您收到的错误消息显示它找不到wikiconfig.py (这是它在没有找到farmconfig.py之后尝试的第二件事)。
你认为wikiconfig.py必须与数据和底座相同的印象是错误的。它只需要在sys.path中的一个目录中。
顺便说一句,如果您不使用debian的方式,并且在您的第一步中不使用apache,您只需从http://moinmo.in/下载存档,解压缩并运行./wikiserver.py,它就能工作了。
https://stackoverflow.com/questions/21386934
复制相似问题