0

I'm following this tutorial to set up a personal Git server on Apache on my Windows 7 box. However, when I add the following to my httpd.conf, Apache throws an error when I try to start it. Can anyone assist in fixing whatever is wrong?

SetEnv GIT_PROJECT_ROOT C:/Repositories
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAliasMatch 
    "(?x)^/(.*/(HEAD | 
                    info/refs | 
                    objects/(info/[^/]+ | 
                             [0-9a-f]{2}/[0-9a-f]{38} | 
                             pack/pack-[0-9a-f]{40}.(pack|idx)) | 
                    git-(upload|receive)-pack))$" 
                    "C:/Program Files (x86)/git/libexec/git-core/git-http-backend.exe/$1"

This is a fresh install of Apache. The only other change I've made to the config file is telling Apache to listen on port 9000 (IIS is listening on 80). This is the error from my event logs:

The Apache service named reported the following error: ScriptAliasMatch takes two arguments, a regular expression and a filename .

I tried putting all of the text on one line, like so:

ScriptAliasMatch "(?x)^/(.*/(HEAD | info/refs | objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{38} | pack/pack-[0-9a-f]{40}.(pack|idx)) | git-(upload|receive)-pack))$" "C:/Program Files (x86)/git/libexec/git-core/git-http-backend.exe/$1"

But nada.

1 Answer 1

2

had the same thing,

it is related to spaces and brak rows...

Try seperating to 3 lines
like so:

# Route specific URLS matching this regular expression to the git http server. 
ScriptAliasMatch \
"(?x)^/(.*/(HEAD | info/refs | objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{38} |     pack/pack-[0-9a-f]{40}.(pack|idx)) | git-(upload|receive)-pack))$" \
"C:\Program Files (x86)\Git\libexec\git-core\git-http-backend.exe/$1" 

keep note, the \ at the line break.

i will attach my file for reference

1
  • 1
    even though it is over a year old question
    – Tomer W
    Nov 12, 2012 at 21:27

You must log in to answer this question.