2014-01-27 76 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,它會只是工作。

相關問題