2014-03-07 177 views
1

我的Mercurial服务器不工作。Ubuntu服务器上的Mercurial服务器

当我访问此页面出现127.0.0.1/mercurial以下文字:

#!/usr/bin/env python 
# 
# An example hgweb CGI script, edit as necessary 
# See also http://mercurial.selenic.com/wiki/PublishingRepositories 

# Path to repo or hgweb config to serve (see 'hg help hgweb') 
config = "/var/www/hgweb.config" 

# Uncomment and adjust if Mercurial is not installed system-wide 
# (consult "installed modules" path from 'hg debuginstall'): 
#import sys; sys.path.insert(0, "/path/to/python/lib") 

# Uncomment to send python tracebacks to the browser if an error occurs: 
#import cgitb; cgitb.enable() 

from mercurial import demandimport; demandimport.enable() 
from mercurial.hgweb import hgweb, wsgicgi 
application = hgweb(config) 
wsgicgi.launch(application) 

我跟着this tutorial

我在目录/var/www/中配置了服务器。

出了什么问题?

回答

1

Apache正在将您的.cgi文件解释为文本文件来运行,而不是运行问题。最有可能的是ScriptAliasMatch或某些使其工作所必需的模块缺失,或者您没有为cgi文件设置执行权限。这应该是在服务器故障 - 这是关于服务器管理而不是软件开发,你可能会得到更详细的答案。

+0

感谢缺乏启用模块:sudo a2enmod cgi – user3393252

+0

是的,没有启用CGI肯定会这样做。 :) –