2010-07-29 6 views
2

J'ai eu du mal à faire fonctionner Mercurial avec Apache sur Windows XP.Exécution Mercurial avec Apache sur Windows XP

J'ai lu et essayé les suggestions suivantes aux fils SO: 1, 2, 3 & 4

Jusqu'à présent, tout ce que je peux est une page blanche et quand je vois la source que je peux voir:

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

Qu'est-ce que je travaille avec:

  • Apache 2,2-C:\Program Files\Apache Software Foundation\Apache2.2\
  • Python 2.4 (tel que recommandé par le site Mercurial) - C:\Program Files\Python\2.4\
  • Mercurial 1,6 - C:\Program Files\Mercurial\
  • mod_python 3.3.1
  • Apache DocumentRoot: C:\htdocs\hg\ accessible via http://hg.paperclip.dev (ajouté au fichier hosts)
  • Hg Repository (sur un lecteur en réseau): H:\repo\

J'ai l'impression qu'une partie de la complication est que je avoir mon repo sur un lecteur en réseau. Ce que je peux accéder soit par une lettre de lecteur en réseau H ou via \\SERVER\WebDev\repo\

Mon mercurial.ini dans le répertoire d'installation Mercurial est comme suit:

[ui] 
editor = Notepad 
username = paperclip <[email protected]> 

Mon hgweb.config dans le Hg DocumentRoot servis par apache (C:\htdocs\hg\)

[collections] 
//SERVER/WebDev/repo = //SERVER/WebDev/repo** 

Mon hgweb.cgi dans le serverd Hg DocumentRoot par 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() 

Mes fichiers VirtualHosts pour 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> 

Compte tenu de la configuration ci-dessus, j'apprécieraient quelques suggestions pour obtenir ce travail. Tout ce que je pourrais essayer comme j'ai atteint une impasse totale.

Merci beaucoup à l'avance.

-P.

Répondre

0

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) 

oublier mod_python,: 81 est IIS sur ma machine et apache est sur 80 et 91, donc http://ap.xxx.tzo.net/cgi-bin/hgweb.cgi fonctionne

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

aussi envvar PYTHONPATH C: \ Python26

Je vous rends compte sont sur une version différente de HG etc, mais j'espère que cela aide. Je pense qu'il m'a fallu 2 jours;)

Essayez avec un dépôt local, votre mercurial.ini est N/A. Mon merc-web.conf ressemble:

[web] 
style = coal 

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

qui applique comme

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

Bonne chance!

Questions connexes