Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, so hell has frozen over and I have finally got this working!</p> <p>I believe there were two things that were fundamentally wrong with my setup.</p> <p>1) The user was not getting authentication passed through, I found this helped:</p> <pre><code>SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER </code></pre> <p>Secondly I couldn't get the physical "Directory" to work.</p> <pre><code>&lt;Directory "C:/GIT/Apache/repositories"&gt; Options +ExecCGI AuthType Basic AuthName intranet AuthUserFile "C:/GIT/Apache/config/users" Require valid-user &lt;/Directory&gt; </code></pre> <p>To resolve this I used locationMatch for both the pull and push. This means you have to authenticate to pull and push. If you wanted annoy pulling you can remove the "git-upload-pack" section.</p> <p>Hope this may help someone else.</p> <p>Here is my final httpd.conf file:</p> <pre><code>DocumentRoot "C:/GIT/Apache/www" &lt;Directory /&gt; Options +ExecCGI Allow from all &lt;/Directory&gt; &lt;Directory "C:/GIT/Apache/www"&gt; Allow from all &lt;/Directory&gt; &lt;Directory "C:/GIT/Apache/www/secure"&gt; AuthType Basic AuthName intranet AuthUserFile "C:/GIT/Apache/config/users" require valid-user &lt;/Directory&gt; SetEnv GIT_PROJECT_ROOT C:/GIT/Apache/repositories SetEnv GIT_HTTP_EXPORT_ALL SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER 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/git/libexec/git-core/git-http-backend.exe/$1" &lt;LocationMatch "^/.*/git-receive-pack$"&gt; Options +ExecCGI AuthType Basic AuthName intranet AuthUserFile "C:/GIT/Apache/config/users" Require valid-user &lt;/LocationMatch&gt; &lt;LocationMatch "^/.*/git-upload-pack$"&gt; Options +ExecCGI AuthType Basic AuthName intranet AuthUserFile "C:/GIT/Apache/config/users" Require valid-user &lt;/LocationMatch&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload