You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Amit Agrawal88 <am...@in.ibm.com> on 2016/08/22 12:21:11 UTC
[users@httpd] 403 Forbidden for git repository over http
Hi All,
I am trying to setup a central Git server which can be accessed over HTTP
protocol.
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
</Directory>
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
everybody.
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"
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ "C:/Program
Files/Git/mingw64/libexec/git-core/git-http-backend/"
However, I get 403 Forbidden error when I try to clone the repository like
this
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
vain.
https://docs.moodle.org/31/en/Manual_install_on_Windows_7_with_Apache_and_MySQL#Step_4:_Configure_Apache_and_PHP
https://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html
http://www.parallelsymmetry.com/howto/git.jsp
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
</LocationMatch>
Also for all fetch requests
<LocationMatch "^/git/.*/git-receive-pack$">
AuthType Basic
AuthName "Git Access"
Require group committers
...
</LocationMatch>
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.
Regards,
Amit
(See attached file: httpd.conf)
Re: [users@httpd] 403 Forbidden for git repository over http
Posted by Amit Agrawal88 <am...@in.ibm.com>.
No Response. Please let me know if any more inputs are required.
Regards,
Amit
From: Amit Agrawal88/India/IBM@IBMIN
To: users@httpd.apache.org
Date: 08/22/2016 05:55 PM
Subject: [users@httpd] 403 Forbidden for git repository over http
Hi All,
I am trying to setup a central Git server which can be accessed over HTTP
protocol.
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
</Directory>
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
everybody.
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"
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ "C:/Program
Files/Git/mingw64/libexec/git-core/git-http-backend/"
However, I get 403 Forbidden error when I try to clone the repository like
this
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 vain.
https://docs.moodle.org/31/en/Manual_install_on_Windows_7_with_Apache_and_MySQL#Step_4:_Configure_Apache_and_PHP
https://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html
http://www.parallelsymmetry.com/howto/git.jsp
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
</LocationMatch>
Also for all fetch requests
<LocationMatch "^/git/.*/git-receive-pack$">
AuthType Basic
AuthName "Git Access"
Require group committers
...
</LocationMatch>
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.
Regards,
Amit
(See attached file: httpd.conf)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org