【发布时间】:2010-07-29 15:09:20
【问题描述】:
我一直在努力让 Mercurial 在 Windows XP 上与 Apache 一起工作。
我已阅读并尝试了以下 SO 线程中的建议:1、2、3 和 4
到目前为止,我只能看到一个空白页,当我查看源代码时,我可以看到:
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>
我在做什么:
- Apache 2.2 --
C:\Program Files\Apache Software Foundation\Apache2.2\ - Python 2.4(由 Mercurial 网站推荐)--
C:\Program Files\Python\2.4\ - Mercurial 1.6 --
C:\Program Files\Mercurial\ -
mod_python3.3.1 - Apache DocumentRoot:
C:\htdocs\hg\通过http://hg.paperclip.dev访问(添加到主机文件中) - Hg 存储库(在网络驱动器上):
H:\repo\
我觉得部分复杂性在于我的存储库位于网络驱动器上。我可以通过网络驱动器号 H 或 \\SERVER\WebDev\repo\
我的Mercurial安装目录下的mercurial.ini如下:
[ui]
editor = Notepad
username = paperclip <p@paperclip.com>
我的 hgweb.config 在 apache 服务的 Hg DocumentRoot 中 (C:\htdocs\hg\)
[collections]
//SERVER/WebDev/repo = //SERVER/WebDev/repo**
我的 hgweb.cgi 在 apache 服务器的 Hg DocumentRoot 中 (C:\htdocs\hg\)
#!C:/Program Files/Python/2.4/python.exe
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "C:/htdocs/hg/hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide:
import sys; sys.path.insert(0, "C:/Program Files/Mercurial/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
from flup.server.fcgi import WSGIServer
application = hgweb(config)
WSGIServer(application).run()
我的 Apache 虚拟主机文件
<VirtualHost *:80>
ServerName hg.paperclip.dev
#ServerAlias paperclip.com *.paperclip.com
ServerAdmin p@paperclip.com
CustomLog "logs/hg-access.log" combined
ErrorLog "logs/hg-error.log"
RewriteEngine on
RewriteRule (.*) C:/htdocs/hg/hgweb.cgi/$1
# Or we can use mod_alias for starting CGI script and making URLs "nice":
# ScriptAliasMatch ^(.*) C:/htdocs/hg/hgweb.cgi/$1
<Directory "C:/htdocs/hg/">
Order allow,deny
Allow from all
AllowOverride All
Options ExecCGI FollowSymLinks +Indexes
AddHandler cgi-script .cgi
</Directory>
</VirtualHost>
考虑到上述配置,我欢迎一些建议以使其正常工作。什么我都可以尝试,因为我已经完全走到了死胡同。
非常感谢。
-P.
【问题讨论】:
标签: apache mercurial windows-xp hgweb