Win7+Apache+Git 403错误

暂时想不到好名字 发布于 2012/09/13 10:20
阅读 1K+
收藏 0

配置如下

<VirtualHost *:8095>

        DocumentRoot "E:/Git"

ErrorLog "E:/Git/apache_error_git.log"

<Directory "E:/Git">

Options Indexes FollowSymLinks

  AllowOverride all

Order Deny,Allow

    Allow from all

</Directory>

 

SetEnv GIT_PROJECT_ROOT E:/Git

 

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:/Program Files/Git/libexec/git-core/git-http-backend.exe/$1"

 

<Location />

AuthType Basic

AuthName "GIT Repository"

AuthUserFile "E:/Git/password"

Require valid-user

</Location>

</VirtualHost>

但是在页面上访问E:/Git/index.htm 输入密码能正常访问,但是用Git clone http://localhost:8095/myapp.git 报错 

$ git clone http://127.0.0.1:8095/myapp.git

Cloning into 'myapp'...

error: The requested URL returned error: 403 while accessing http://127.0.0.1:80

95/myapp.git/info/refs

fatal: HTTP request failed

 

请问如何解决啊?那位大侠知道?我在网上搜了很久没有答案··· 

Apache错误日志显示  client denied by server configuration:D:/Program Files/Git/libexec/git-core/git-http-backend.exe


加载中
0
暂时想不到好名字
暂时想不到好名字

找到答案了,配置如下就正确了

<VirtualHost *:8095>

ErrorLog "E:/Git/apache_error_git.log"

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:/Program Files/Git/libexec/git-core/git-http-backend.exe/$1"

    <Directory "D:/Program Files/Git/libexec/git-core/">

        Allow from all

    </Directory>

    <Directory />

        AuthType Basic

        AuthName "GIT Repository"

        AuthUserFile "E:/Git/password"

Require valid-user

    </Directory>

</VirtualHost>

0
暂时想不到好名字
暂时想不到好名字
折腾了很久原来没有权限是指的Git应用没有权限
返回顶部
顶部