我最近升级了服务器上的 mercurial,现在我的 hgweb.cgi 脚本出现以下错误。当我在线搜索时,我只找到有关 Windows 计算机的安装教程,其中谈到了模板,甚至没有指定从何处获取模板。有人能帮我让我的服务器重新运行吗?
[Thu May 28 08:06:42 2015] [error] [client 213.135.239.28] (13)Permission denied: exec of '/var/www/mercurial/htdocs/hgweb.cgi' failed
[Thu May 28 08:06:42 2015] [error] [client 213.135.239.28] Premature end of script headers: hgweb.cgi
[Thu May 28 08:07:02 2015] [error] [client 213.135.239.28] (13)Permission denied: exec of '/var/www/mercurial/htdocs/hgweb.cgi' failed
[Thu May 28 08:07:02 2015] [error] [client 213.135.239.28] Premature end of script headers: hgweb.cgi
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] Traceback (most recent call last):
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] File "/var/www/mercurial/htdocs/hgweb.cgi", line 19, in <module>
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28]
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] wsgicgi.launch(application)
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] File "/usr/lib/pymodules/python2.6/mercurial/hgweb/wsgicgi.py", line 76, in launch
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28]
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] content = application(environ, start_response)
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] File "/usr/lib/pymodules/python2.6/mercurial/hgweb/hgwebdir_mod.py", line 153, in __call__
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28]
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] return self.run_wsgi(req)
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] File "/usr/lib/pymodules/python2.6/mercurial/hgweb/hgwebdir_mod.py", line 183, in run_wsgi
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28]
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] tmpl = self.templater(req)
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] File "/usr/lib/pymodules/python2.6/mercurial/hgweb/hgwebdir_mod.py", line 435, in templater
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28]
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] style, mapfile = templater.stylemap(styles, self.templatepath)
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] File "/usr/lib/pymodules/python2.6/mercurial/templater.py", line 761, in stylemap
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28]
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] raise RuntimeError("No hgweb templates found in %r" % paths)
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] RuntimeError
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] :
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] No hgweb templates found in []
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28]
[Thu May 28 08:10:01 2015] [error] [client 213.135.239.28] Premature end of script headers: hgweb.cgi
答案1
经过大量搜索:
将以下内容添加到您的 hgweb.config 文件中:
[web]
templates = /usr/share/mercurial/templates