Serving Hg repositories on Windows + Apache - python crashes.

Alexander Kaufman alexander.kaufman at skymobilemedia.com
Thu Feb 7 07:47:48 CST 2008


Hello!

 

I have problem publishing repositories.

When browsing to : http://hg.internal.int  I'm getting Error 500 (see below)

 

Tried different ways to give paths with and without drive letter. I do know that the fatal error happens after parsing of all configs, 

since if I make intended error in config, python reports immediately and only when configs are correct I'm getting application fault.

Any idea/assistance will be greatly appreciated. 

 

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin at internal.int and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

What really happens is that the python crashing. There is a record about that in EventLog.

Event Type:        Error

Event Source:    Application Error

Event Category:                (100)

Event ID:              1000

Date:                     2/7/2008

Time:                     3:12:53 PM

User:                     N/A

Computer:          SERVER

Description:

Faulting application python.exe, version 0.0.0.0, faulting module python25.dll, version 2.5.1150.1013, fault address 0x00062995.

 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Data:

0000: 41 70 70 6c 69 63 61 74   Applicat

0008: 69 6f 6e 20 46 61 69 6c   ion Fail

0010: 75 72 65 20 20 70 79 74   ure  pyt

0018: 68 6f 6e 2e 65 78 65 20   hon.exe 

0020: 30 2e 30 2e 30 2e 30 20   0.0.0.0 

0028: 69 6e 20 70 79 74 68 6f   in pytho

0030: 6e 32 35 2e 64 6c 6c 20   n25.dll 

0038: 32 2e 35 2e 31 31 35 30   2.5.1150

0040: 2e 31 30 31 33 20 61 74   .1013 at

0048: 20 6f 66 66 73 65 74 20    offset 

0050: 30 30 30 36 32 39 39 35   00062995

 

 

In Apache Error.log appears: 
[Thu Feb 07 15:20:32 2008] [error] [client 10.0.100] Premature end of script headers: hgwebdir.cgi

 

I wrote simple "Hello World" and it works correctly.

 

Setup:  HG with Python

OS: Windows 2003 R2 Server

http server: Apache 2.0.54

HG 0.9.5

Python: 2.5.1

I made install using the Mercurial-NSI-0.9.5-0.9-py2.5.exe installer.

 

Here are my configs related to the installation:

 

httpd.conf

-------------------

<VirtualHost 10.0.0.10:80>

DocumentRoot "e:/mercurial"

ServerName hg.internal.int

                <IfModule mod_rewrite.c>

                                RewriteEngine on

RewriteRule ^/(.*) /hgwebdir.cgi/$1

</IfModule>

                <Directory "e:/mercurial">

                                                DirectoryIndex hgwebdir.cgi

                                                AddHandler cgi-script .cgi

                                                Options ExecCGI

                                                Order allow,deny

                                                Allow from all

                #AuthUserFile /etc/hg/htpasswd

                #AuthName "Dev Repo"

                #AuthType Basic

                #<Limit POST PUT>

                #        Require valid-user

                #</Limit>

        </Directory>

</VirtualHost>

 

hgwebdir.cgi

--------------------

#!c:/python25/python.exe

#

# An example CGI script to export multiple hgweb repos, edit as necessary

 

# adjust python path if not a system-wide install:

#import sys

#sys.path.insert(0, "c:/python25/lib")

 

# enable importing on demand to reduce startup time

from mercurial import demandimport; demandimport.enable()

 

# send python tracebacks to the browser if an error occurs:

import cgitb

cgitb.enable()

 

# If you'd like to serve pages with UTF-8 instead of your default

# locale charset, you can do so by uncommenting the following lines.

# Note that this will cause your .hgrc files to be interpreted in

# UTF-8 and all your repo files to be displayed using UTF-8.

#

import os

os.environ["HGENCODING"] = "UTF-8"

 

from mercurial.hgweb.hgwebdir_mod import hgwebdir

from mercurial.hgweb.request import wsgiapplication

import mercurial.hgweb.wsgicgi as wsgicgi

 

# The config file looks like this.  You can have paths to individual

# repos, collections of repos in a directory tree, or both.

#

#[paths]

#pilot = e:/mercurial/pilot

#virtual/path = /real/path

#virtual/path = /real/path

#

# [collections]

# /prefix/to/strip/off = /root/of/tree/full/of/repos

#

# collections example: say directory tree /foo contains repos /foo/bar,

# /foo/quux/baz.  Give this config section:

#   [collections]

#   /foo = /foo

# Then repos will list as bar and quux/baz.

#

# Alternatively you can pass a list of ('virtual/path', '/real/path') tuples

# or use a dictionary with entries like 'virtual/path': '/real/path'

 

def make_web_app():

    return hgwebdir("hgweb.config")

 

wsgicgi.launch(wsgiapplication(make_web_app))

 

hgweb.config

-------------------

[paths]

project = project

 

 

Thanks again,

Alexander Kaufman



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20080207/b885077a/attachment.htm 


More information about the Mercurial mailing list