Forum Moderators: phranque
SetEnv GIT_PROJECT_ROOT /var/www/html/git
SetEnv GIT_HTTP_EXPORT_ALL 1
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
<Directory "/usr/lib/git-core/">
Options +ExecCGI +SymLinksIfOwnerMatch
# Order allow,deny
Require all granted
</Directory>
ScriptAliasMatch \
"(?x)^/git/(.*/(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))$" \
/usr/lib/git-core/git-http-backend/$1
<Location /git/Repository.git>
AuthType Basic
AuthName "Git Repository"
AuthUserFile /etc/apache2/git_rep_passwd
Require valid-user
SSLRequireSSL
</Location>
[Mon Oct 27 10:58:08.894128 2014] [core:info] [pid 32425] [client 194.138.12.166:15488] AH00130: File does not exist: /usr/lib/git-core/git-http-backend/DLR_SMCS.git/info/refs, referer: https://example.com/git/Repository.git/info/
[Mon Oct 27 11:00:57.555363 2014] [authz_core:debug] [pid 32812] mod_authz_core.c(802): [client xxx:51894] AH01626: authorization result of <RequireAny>: granted, referer: https://example.com/git/Repository.git/
[Mon Oct 27 11:00:57.555583 2014] [deflate:debug] [pid 32812] mod_deflate.c(849): [client xxx:51894] AH01384: Zlib: Compressed 1172 to 475 : URL /git/Repository.git/info/, referer: https://example.com/git/Repository.git/
[Mon Oct 27 11:00:58.855353 2014] [access_compat:error] [pid 32812] [client xxx:51894] AH01797: client denied by server configuration: /usr/lib/git-core/git-http-backend, referer: https://example.com/git/Repository.git/info/
The Order allow,deny was said to be not needed for 2.4 in some upgrade guide
When I add it, it does recognize the CGI, but access is forbidden.
Do you have an "Order" directive lurking about under some higher directory? "Allow,Deny" is the default -- meaning, in your case, that if there's no match, all requests are denied -- but the observed behavior makes it look as if there's a "Deny,Allow" somewhere further up the chain.
Yup, that's a <Location> not a <Directory>. So the enclosed rules -- including "Allow,Deny" -- apply to an URL, whether or not there's a physical file involved.
<Location /git/>
Options +ExecCGI +SymLinksIfOwnerMatch
Require all granted
</Location>
[Wed Oct 29 17:56:50.992016 2014] [authz_core:debug] [pid 41505] mod_authz_core.c(802): [client xxx:14492] AH01626: authorization result of Require valid-user : granted, referer: https://example.com/git/Repository.git/info/
[Wed Oct 29 17:56:50.992025 2014] [authz_core:debug] [pid 41505] mod_authz_core.c(802): [client xxx:14492] AH01626: authorization result of <RequireAny>: granted, referer: https://example.com/git/Repository.git/info/
[Wed Oct 29 17:56:50.992058 2014] [core:info] [pid 41505] [client xxx:14492] AH00130: File does not exist: /usr/lib/git-core/git-http-backend/Repository.git/info/refs, referer: https://example.com/git/Repository.git/info/