Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

share|improve this answer
1  
even though it is over a year old question –  Tomer W Nov 12 '12 at 21:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.