0

I have configured git server using apache on windows. Below is my httpd.conf added line

SetEnv GIT_PROJECT_ROOT D:/GitWithTorque/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))$" \
"D:/GitWithTorque/ProgramFiles/Git/libexec/git-core/git-http-backend.exe/$1"

If I write like below

<Directory />
Allow from all
AuthType Basic
AuthName "Repository Authorization"
AuthUserFile D:/GitWithTorque/Authorization/.htpasswd
Require valid-user
</Directory>

I can clone repository using smart git.

But I want to do this authentication only for git repository by specifying Directory Path If I write like below, Then if I try to clone using smart git, it shows path not exists.

<Directory D:/GitWithTorque/Repositories/>
Allow from all
AuthType Basic
AuthName "Repository Authorization"
AuthUserFile D:/GitWithTorque/Authorization/.htpasswd
Require valid-user
</Directory>

Above Will not work. What could be the Problem.

I want to specify authentication for a specific folder. so that if I browse html pages(Resides outside git repositories) which are connected from same server should not prompt for username and password. Thanks

1 Answer 1

0

Try to enclose the path inside double quotes like,

<Directory "D:/GitWithTorque/Repositories/">

may the magic of quotes will work for you :)

You must log in to answer this question.