在 Windows XP 上使用 Apache 运行 Mercurial
我一直在努力让 Mercurial 在 Windows XP 上与 Apache 一起工作。
到目前为止,我所能看到的只是一个空白页面,当我查看源代码时,我可以看到:
<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_python
3.3.1- Apache DocumentRoot:
C:\htdocs\hg\< /code> 通过
http://hg.paperclip.dev
访问(添加到主机文件) - Hg 存储库(在网络驱动器上):
H:\repo\
我有我觉得复杂的部分原因是我的存储库位于网络驱动器上。我可以通过网络驱动器号 H 或通过 \\SERVER\WebDev\repo\
访问
Mercurial 安装目录中的 mercurial.ini
如下:
[ui]
editor = Notepad
username = paperclip <[email protected]>
My < code>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 VirtualHosts 文件
<VirtualHost *:80>
ServerName hg.paperclip.dev
#ServerAlias paperclip.com *.paperclip.com
ServerAdmin [email protected]
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。
I've been struggling to get Mercurial working with Apache on Windows XP.
I've read and tried the suggestions at the following SO threads: 1, 2, 3 & 4
So far all I can is a blank page and when I view the source I can see:
<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>
What I'm working with:
- Apache 2.2 --
C:\Program Files\Apache Software Foundation\Apache2.2\
- Python 2.4 (as recommended by Mercurial site) --
C:\Program Files\Python\2.4\
- Mercurial 1.6 --
C:\Program Files\Mercurial\
mod_python
3.3.1- Apache DocumentRoot:
C:\htdocs\hg\
accessed viahttp://hg.paperclip.dev
(added to hosts file) - Hg Repository (on a networked drive):
H:\repo\
I have a feel that part of the complication is that I have my repo on a networked drive. Which I can access either through a networked drive letter H or via \\SERVER\WebDev\repo\
My mercurial.ini
in the Mercurial installation directory is as follows:
[ui]
editor = Notepad
username = paperclip <[email protected]>
My hgweb.config
in the Hg DocumentRoot served by apache (C:\htdocs\hg\
)
[collections]
//SERVER/WebDev/repo = //SERVER/WebDev/repo**
My hgweb.cgi
in the Hg DocumentRoot serverd by apache (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()
My VirtualHosts files for Apache
<VirtualHost *:80>
ServerName hg.paperclip.dev
#ServerAlias paperclip.com *.paperclip.com
ServerAdmin [email protected]
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>
Taking into account the above configuration, I would welcome some suggestions to get this working. Anything I could try as I've hit a total dead end.
Many thanks in advance.
-P.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是昨天发布的:
在 Windows 计算机中设置 Mercurial Server - 教程已过时
这家伙设法让 HG + Apache 在 Windows 7 上工作。
我知道,您使用的是 XP,而不是 Win 7,但也许这个链接对您有帮助。
This was posted just yesterday:
Setup Mercurial Server in Windows Machine - Tutorials are outdated
This guy managed to get HG + Apache to work on Windows 7.
I know, you're using XP and not Win 7, but maybe this link helps you anyway.
Hg 2.0.1
Apache 2.2.21
Python 2.6!
忘记 mod_python,:81 是我机器上的 IIS,apache 位于 80 和 91 上,所以 http://ap.xxx.tzo.net/cgi-bin/hgweb.cgi
也适用于 envvar PYTHONPATH C:\Python26
我意识到你使用的是不同版本的 HG 等,但我希望这会有所帮助。
我想我花了 2 天;)
尝试使用本地存储库,你的 Mercurial.ini 不适用。我的 Merc-web.conf 看起来像:
适用于
http://ap .xxx.tzo.net/cgi-bin/hgweb.cgi/hgAppThree
祝你好运!
Hg 2.0.1
Apache 2.2.21
Python 2.6!
forget about mod_python, :81 is IIS on my machine and apache is on 80 and 91, so http://ap.xxx.tzo.net/cgi-bin/hgweb.cgi works
also envvar PYTHONPATH C:\Python26
I realize you are on different version of HG etc, but I hope this helps.
I think it took me 2 days ;)
Try with a local repo, your mercurial.ini is N/A. My merc-web.conf looks like:
which applies like
http://ap.xxx.tzo.net/cgi-bin/hgweb.cgi/hgAppThree
Good luck!