简体   繁体   English

在Debian Wheezy上设置MoinMoin时出现问题

[英]Problems setting up MoinMoin on Debian Wheezy

I have problems setting up a single MoinMoin wiki on Debian Wheezy. 我在Debian Wheezy上设置单个MoinMoin Wiki时遇到问题。 What I want is a wiki at localhost/MyWiki (actually I don't care where it is exactly). 我想要的是localhost/MyWiki (实际上,我不在乎它的确切位置)。 I followed three different installation guides: The official README.Debian of the Debian package, the MoinMoin Installation Guide for Debian and Oz123's install notes , all to no avail. 我遵循了三种不同的安装指南:Debian软件包的官方README.Debian,针对Debian的MoinMoin安装指南Oz123的安装说明 ,但均无济于事。

Here are my setup notes (sorry for the length but since the configuration is not trivial, I thought I'd better be specific): 这是我的设置说明(很抱歉,虽然长度不长,但由于配置并不简单,我认为最好还是具体说明):

1) Create and populate /var/www/mywiki : 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) Pass on the wiki to Apache: 2)将Wiki传递给Apache:

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

3) Configure Apache2: 3)配置Apache2:

Add the following as /etc/apache2/sites-available/mywiki : 将以下内容添加为/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: 4)配置MoinMoin:

Edit /etc/moin/mywiki.py to include these lines (NOTE: After installing python-moinmoin , /etc/moin did not contain a file named mywiki.py , so I search-copied it first: 编辑/etc/moin/mywiki.py以包括这些行(注意:安装python-moinmoin/etc/moin不包含名为mywiki.py的文件,因此我首先对其进行了搜索复制:

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

Then I added/changed the file to include the following lines: 然后,我添加/更改了文件以包括以下几行:

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

Then I appended www-data localhost to /etc/moin/wikilist : 然后我将www-data localhost附加到/etc/moin/wikilist

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

5) Activate wiki: 5)激活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). 6)在http://your.site/MyWiki/LanguageSetup访问新的Wiki,然后创建您的帐户(根据您在上面指定的超级用户的名称)。

However, visiting http://localhost/MyWiki/LanguageSetup gave the following error: 但是,访问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.

So I search for wikiconfig.py : 所以我搜索wikiconfig.py

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

Reading through wikiconfig.py , I found out that this file should reside in the same dir as data/ and underlay/ . 通过阅读wikiconfig.py ,我发现该文件应与data/underlay/驻留在同一目录中。 Since I copied both dir's to /var/lib/mywiki in step 1), I copied this script there as well: 由于我在步骤1)中将两个目录都复制到了/var/lib/mywiki ,因此我也将该脚本复制到了那里:

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

I also changed sitename = u'Untitled Wiki' to sitename = u'MyWiki' to match with the configuration in mywiki.py (step 4). 我也改变sitename = u'Untitled Wiki'sitename = u'MyWiki' ,以配合在配置mywiki.py (步骤4)。 Still, visiting http://localhost/MyWiki/LanguageSetup gave another error: 不过,访问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.

Why is the script trying to find data in /usr/share/moin/server/data and not in /var/lib/mywiki/data as I configured it in mywiki.py (cf. step 4)? 为什么脚本会尝试在mywiki.py配置data/usr/share/moin/server/data而不是在/var/lib/mywiki/datamywiki.py (参见步骤4)? Having tried getting MoinMoin to run more times thant I care to admit, I wondered whether maybe one of you guys can point out the obvious error in my ways ... 尝试让MoinMoin运行多次而不是我想承认的那样,我想知道也许你们中的某人是否可以用我的方式指出明显的错误...

you seem to want to do it the debian package way: 您似乎想用debian软件包的方式来做:

install the debian package (apt-get install python-moinmoin or so) 安装debian软件包(apt-get install python-moinmoin左右)

then the wiki farm configs are in /etc/moin/*.py because debian puts them there - carefully edit them, but do not remove the farmconfig.py (because the debian setup IS a wiki farm configuration, you can start with 1 wiki and later add more wikis). 则Wiki场配置位于/etc/moin/*.py中,因为debian将它们放置在此处-仔细编辑它们,但不要删除farmconfig.py(因为debian设置是Wiki场配置,您可以以1个Wiki开头然后添加更多Wiki)。

debian should have adaptor scripts (like moin.cgi or moin.wsgi) that insert '/etc/moin' into sys.path (sys.path is where python search for code) - check this, the error message you get says it doesn't find wikiconfig.py (which is the second thing it tries after failing to find farmconfig.py) debian应该具有适配器脚本(例如moin.cgi或moin.wsgi),该适配器脚本会将'/ etc / moin'插入sys.path(sys.path是python搜索代码的位置)-检查此错误,得到的错误消息说它没有找不到wikiconfig.py(这是未能找到farmconfig.py之后尝试的第二件事)

your impression that wikiconfig.py must be in same dir as data and underlay is wrong. 您的印象是wikiconfig.py必须与数据位于同一目录,并且参考底图是错误的。 it just needs to be in a directory in sys.path. 它只需要位于sys.path中的目录中即可。

btw, if you don't do it the debian way and don't use apache for your first moin steps, you can just download the archive from http://moinmo.in/ , unpack it and run ./wikiserver.py and it'll just work. 顺便说一句,如果您不使用debian方式并且不使用apache作为您的第一步,则只需从http://moinmo.in/下载档案,将其解压缩并运行./wikiserver.py和它会工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM