代码之家  ›  专栏  ›  技术社区  ›  purecharger

Mercurial:对hgwebdir的权限被拒绝

  •  2
  • purecharger  · 技术社区  · 16 年前

    昨天,我安装了Apache来为我的Mercurial存储库提供服务,并使一切正常工作。然后,我测试了将更改推回这个存储库的过程,结果出现了一个错误,现在我尝试的每一个操作都会出现这个错误——甚至只是对存储库的一个简单的GET请求!错误如下:

    mod_wsgi (pid=1771): Target WSGI script '/var/hg/hgweb.wsgi' cannot be loaded as Python module.
    mod_wsgi (pid=1771): Exception occurred processing WSGI script '/var/hg/hgweb.wsgi'.
    Traceback (most recent call last):
      File "/var/hg/hgweb.wsgi", line 18, in ?
        application = hgwebdir(config)
      File "/usr/lib64/python2.4/site-packages/mercurial/hgweb/__init__.py", line 15, in hgwebdir
        return hgwebdir_mod.hgwebdir(*args, **kwargs)
      File "/usr/lib64/python2.4/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 52, in __init__
        self.refresh()
      File "/usr/lib64/python2.4/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 82, in refresh
        self.repos = findrepos(paths)
      File "/usr/lib64/python2.4/site-packages/mercurial/hgweb/hgwebdir_mod.py", line 36, in findrepos
        for path in util.walkrepos(roothead, followsym=True, recurse=recurse):
      File "/usr/lib64/python2.4/site-packages/mercurial/util.py", line 1164, in walkrepos
        for hgname in walkrepos(fname, True, seen_dirs):
      File "/usr/lib64/python2.4/site-packages/mercurial/util.py", line 1146, in walkrepos
        for root, dirs, files in os.walk(path, topdown=True, onerror=errhandler):
      File "/usr/lib64/python2.4/os.py", line 276, in walk
        onerror(err)
      File "/usr/lib64/python2.4/site-packages/mercurial/util.py", line 1127, in errhandler
        raise err
    OSError: [Errno 13] Permission denied: './dev/fd'
    

    1 回复  |  直到 16 年前
        1
  •  3
  •   purecharger    16 年前

    我发现这是一个配置错误,我不会删除这个问题,而是在这里发布解决方案,以防将来有人遇到这个问题。

    以下是我使用的hgweb.config:

    [paths]
    / = /var/hg/repos/*
    
    #[web]
    style = gitweb
    allow_archive = bz2 gz zip
    maxchanges = 200
    allow_push = *
    push_ssl = false
    

    [web] header注释掉了,我假设许多选项对于 [paths] 部分。另外,在重新读取Hg文档之后,push\u ssl指令不属于 hgweb.config 文件,而是在每个存储库的 .hg/hgrc (或 ~/.hgrc 运行apache的用户)。修好后,一切都很好!

    推荐文章