Linux 发行版升级后,WSGI 下的 Moin 抛出 500 个错误

Linux 发行版升级后,WSGI 下的 Moin 抛出 500 个错误

我有一个摩因摩因实例安装在/opt/mydebianwiki;wiki 在 [wsgi] / [apache2] 下运行。我最近从 Debian Linux 6 (squeeze) 升级到了 Debian 7 (wheezy);升级之前,我的摩因摩因实例运行良好。

然而,升级到 wheezy 之后,当我尝试访问该网站时开始出现 http 500 错误。

谷歌搜索让我找到了这个moin-用户线程,它说我可以直接运行su -c "moin --config-dir=/opt/mydebianwiki maint cleancache" www-data来修复该问题;然而,这同样不成功(请参阅问题底部的错误)。

我该如何解决这个问题?


root@tsunami:/opt/mydebianwiki# su -c "moin --config-dir=/opt/mydebianwiki maint cleancache" www-data
2014-03-01 04:14:46,749 WARNING MoinMoin.log:139 using logging configuration read from built-in fallback in MoinMoin.log module!
2014-03-01 04:14:46,887 INFO MoinMoin.config.multiconfig:93 using farm config: /etc/moin/farmconfig.pyc
Traceback (most recent call last):
  File "/usr/bin/moin", line 5, in <module>
    run()
  File "/usr/lib/python2.7/dist-packages/MoinMoin/script/moin.py", line 15, in run
    MoinScript().run(showtime=0)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "/usr/lib/python2.7/dist-packages/MoinMoin/script/__init__.py", line 261, in mainloop
    plugin_class(args[2:], self.options).run() # all starts again there
  File "/usr/lib/python2.7/dist-packages/MoinMoin/script/__init__.py", line 138, in run
    self.mainloop()
  File "/usr/lib/python2.7/dist-packages/MoinMoin/script/maint/cleancache.py", line 39, in mainloop
    self.init_request()
  File "/usr/lib/python2.7/dist-packages/MoinMoin/script/__init__.py", line 185, in init_request
    self.request = ScriptContext(url, self.options.page)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/web/contexts.py", line 439, in __init__
    wsgiapp.init(self)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", line 51, in init
    context.lang = setup_i18n_preauth(context)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/wsgiapp.py", line 233, in setup_i18n_preauth
    i18n.i18n_init(context)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/i18n/__init__.py", line 72, in i18n_init
    meta_cache = caching.CacheEntry(request, 'i18n', 'meta', scope='wiki', use_pickle=True)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/caching.py", line 71, in __init__
    self.arena_dir = get_arena_dir(request, arena, scope)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/caching.py", line 32, in get_arena_dir
    return os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/web/contexts.py", line 56, in get
    res = obj.environ.setdefault(self.name, factory(obj))
  File "/usr/lib/python2.7/dist-packages/MoinMoin/web/contexts.py", line 128, in cfg
    cfg = multiconfig.getConfig(self.request.url)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/config/multiconfig.py", line 193, in getConfig
    cfg = _makeConfig(cfgName)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/config/multiconfig.py", line 125, in _makeConfig
    cfg = configClass(name)
  File "/usr/lib/python2.7/dist-packages/MoinMoin/config/multiconfig.py", line 277, in __init__
    self._check_directories()
  File "/usr/lib/python2.7/dist-packages/MoinMoin/config/multiconfig.py", line 604, in _check_directories
    raise error.ConfigurationError(msg)
MoinMoin.error.ConfigurationError:
data_dir "/org/mywiki/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.

root@tsunami:/opt/mydebianwiki#

答案1

问题是,/opt/mydebianwiki/wikiconfig.py尽管我在命令中指定了该目录,但还是找不到我的本地 moin 配置moin ... maint cleancache。似乎/etc/moin当我运行 时,debian 的默认目录 ( ) 优先su -c "moin --config-dir=/opt/mydebianwiki maint cleancache" www-data

我的解决方案是暂时重命名/etc/moin并运行该命令。这解决了问题:

root@tsunami:/opt/mydebianwiki# mv /etc/moin/ /etc/antimoin

root@tsunami:/opt/mydebianwiki# su -c "moin --config-dir=/opt/mydebianwiki maint 
 cleancache" www-data
2014-03-01 04:17:11,922 WARNING MoinMoin.log:139 using logging configuration read 
from built-in fallback in MoinMoin.log module!
2014-03-01 04:17:12,067 INFO MoinMoin.config.multiconfig:127 using wiki config: 
/opt/mydebianwiki/wikiconfig.pyc

root@tsunami:/opt/mydebianwiki# apachectl restart
root@tsunami:/opt/mydebianwiki# mv /etc/antimoin/ /etc/moin

相关内容