httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amit Agrawal88" <>
Subject [users@httpd] 403 Forbidden for git repository over http
Date Mon, 22 Aug 2016 12:21:11 GMT

Hi All,
I am trying to setup a central Git server which can be accessed over HTTP
I have installed Bitnami WAMP stack with Apache 2.4 version.  The Git
repository is located in C:\Git\Repos.
In httpd.conf file, I have changed the Document Root folder to C:\Git\Repos

   DocumentRoot "C:\Git\Repos"
   <Directory "C:\Git\Repos">
       Options All
       AllowOverride All
       Require all granted

There are not .httpaccess file in C:\Git\Repos so 'AllowOverride All' has
no effect, I could have kept it None as well. To begin with, I am just
trying to serve git repository over http and hence I have allowed access to
The Env variable for Git has been set and all GET request ending with /git/
is redirected to git-http-backend.

   SetEnv GIT_PROJECT_ROOT "C:\Git\Repos"
   ScriptAlias /git/ "C:/Program

However, I get 403 Forbidden error when I try to clone the repository like
   C:\test>git clone http://localhost:80/git/Projects/example
   Cloning into 'example'...
   fatal: unable to access 'http://localhost:80/git/Projects/example/': The
   requested URL returned error: 403

. Following is the error in access log
   ::1 - - [22/Aug/2016:16:44:54 +0530] "GET /git/ HTTP/1.1" 403 213

Error in Error Log
   [client ::1:64266] AH01630: client denied by server configuration:
   C:/Program Files/Git/mingw64/libexec/git-core/git-http-backend

So it looks like git-http-backend is not allowing this access. As per the
documentation, it concatenates environment variables PATH_INFO with
GIT_PROJECT_ROOT which seems be correctly set. I also tried "AcceptPathInfo
On" but that didn't help.

I have been reading and trying lots of things  like the ones mentioned
below including searching this forum to any solution to this but still in

I have tried to give location access to /git/ path but that didn't help
   <LocationMatch "^/git/">
           AuthType Basic
           AuthName "Git Access"
           Require all granted
Also for all fetch requests

   <LocationMatch "^/git/.*/git-receive-pack$">
           AuthType Basic
           AuthName "Git Access"
           Require group committers

I also given Read/write access to C:\Git\Repos to ALL users in the system.
I am using Windows Server 2012 R2.

I have a feeling that either some of the above configuration is wrong OR
git-http-backend is expecting something which I have not set.

I have been trying to setup the access for last few days and above are just
few of things that I tried. Kindly help.

Please don't remove this post as I searched the forum already and didn't
come across any similar post with solution.

   (See attached file: httpd.conf)

View raw message