Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Sep 13 '11 at 15:03

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer 1

Try to enclose the path inside double quotes like,

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

may the magic of quotes will work for you :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.