Frage

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 via http://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 <p@paperclip.com>

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 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>

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.

War es hilfreich?

Lösung

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.

Andere Tipps

Hg 2.0.1

Apache 2.2.21

Python 2.6!

#!c:/python26/python.exe
#
# 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 = "/path/to/repo/or/config"
config = "c:/batch/merc-web.conf"

# 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")
#import sys; sys.path.insert(0, "c:/mercurial")

# 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)

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

<VirtualHost *:80>
ServerName ap.xxx.tzo.net
ServerAlias ap.xxx.tzo.net

ProxyPreserveHost On
ProxyPass / http://localhost:91/
ProxyPassReverse / http://localhost:91/
<Proxy http://localhost:91/>
#  Order Allow,Deny
#  Allow from all
   Order Deny,Allow
   Allow from 127.0.0.1
</Proxy>
</VirtualHost>

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:

[web]
style = coal

[paths]
/hgAppThree = C:\!mark\_dev\hgAppThree

which applies like

http://ap.xxx.tzo.net/cgi-bin/hgweb.cgi/hgAppThree

Good luck!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top