2014-01-27 127 views
1

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

这里是我设置的注释(遗憾的长度,但因为配置是不平凡的,我想我最好还是具体的):

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)访问您的新维基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/。由于我在步骤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/datadata而不是/var/lib/mywiki/data我在mywiki.py(参见第4步)配置呢?试图让MoinMoin运行更多次,我无意承认,我想知道你们中的一个人是否可以在我的方式中指出明显的错误...

回答

0

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

安装Debian软件包(apt - get安装的python-的MoinMoin左右)

那么维基农场CONFIGS在/etc/moin/*.py因为Debian却放在他们那里 - 精心编辑,但做不要删除farmconfig.py(因为debian安装程序是一个wiki农场配置,你可以从1维基开始,后来添加更多维基)。我们可以在Debian中安装适配器脚本(如moin.cgi或moin.wsgi),它将'/ etc/moin'插入sys.path(sys.path是python搜索代码的地方) - 检查这个错误消息get说它找不到wikiconfig.py(这是它在找到farmconfig.py失败后所尝试的第二件事)

您的印象是wikiconfig.py必须与数据和底图相同,才能显示错误。 它只需要在sys.path中的目录中。

顺便说一句,如果你不这样做的debian的方式,并没有使用Apache的第一个moin步骤,你可以从http://moinmo.in/下载档案,解压缩并运行./wikiserver.py,它会只是工作。