无法通过 smart-http 推送目录

发布于 2024-10-18 11:42:25 字数 2621 浏览 2 评论 0原文

我已经连续两天这样做了,我放弃了自己寻找解决方案。 我正在尝试在服务器上设置Redmine - 这部分进展顺利。我还尝试安装 git 存储库,但尽管我已经能够通过 SSH 很好地克隆和拉取,但通过 HTTP 执行同样的操作却很困难。

首先,这是详细的 git 推送错误:

========================================== ==========================

$ GIT_CURL_VERBOSE=1 git push http://192.168.0.13/gitweb/Project master * 在_netrc文件中找不到主机192.168.0.13;使用默认值 * 即将连接()到192.168.0.13端口80(#0) * 正在尝试 192.168.0.13... * 0x20ab4f0 位于发送管道头! * 连接到 192.168.0.13 (192.168.0.13) 端口 80 (#0)

GET /gitweb/Project/info/refs?service=git-receive-pack HTTP/1.1 用户代理:git/1.7.4.3282.g844cb 主机:192.168.0.13 接受:/ 编译指示:无缓存

  • 请求的 URL 返回错误:403
  • 过期已清除
  • 正在关闭连接 #0
  • 无法在 _netrc 文件中找到主机 192.168.0.13;使用默认值
  • About to connect() to 192.168.0.13 port 80 (#0)
  • Trying 192.168.0.13... * 0x20ab4f0 位于发送管道头!
  • 已连接到 192.168.0.13 (192.168.0.13) 端口 80 (#0)

    <块引用>

    获取 /gitweb/Project/info/refs HTTP/1.1 用户代理:git/1.7.4.3282.g844cb 主机:192.168.0.13 接受:/ 编译指示:无缓存

  • 请求的 URL 返回错误:403

  • 正在关闭连接 #0 错误:访问 http://192.168.0.13 时,请求的 URL 返回错误:403 /gitweb/Project/info/refs

fatal: HTTP 请求失败

======================================= ===========================

所以显然有一些错误配置的权限,尽管我已经暂时将我的存储库文件夹修改为 777。

我想你'也会对apache的配置感兴趣:

============================================= =======================

ServerAdmin webmaster@localhost

[...snip...]

PerlLoadModule Apache::Redmine
SetEnv GIT_PROJECT_ROOT /var/cache/git/
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/

<Location "/git/">
    DAV on
    AuthType Basic
    AuthName "Git Repository"
    Require valid-user

    PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler

    RedmineDSN "DBI:mysql:database=redmine;host=localhost"
    RedmineDbUser "redmine" 
    RedmineDbPass "XXXXXXX" 
    RedmineGitSmartHttp yes
</Location>

Alias /gitweb/ "/var/cache/git/public/"
<Location "/gitweb/">
    Order deny,allow
    Deny from all
    <Limit GET PROPFIND OPTIONS REPORT>
       Options Indexes FollowSymLinks MultiViews
       Allow from 127.0.0.1
       Allow from localhost
    </Limit>
</Location>

=================================================== ==============

所以,如果有人能好心地给我一个关于该做什么的提示,我真的很感激。提前致谢!

I've been going a this for two days in a row now, and I'm giving up on finding the solution all by myself.
I am trying to set up Redmine on a server - that part went well. I am also trying to install a git repository, but although I've been able to clone and pull perfectly well via SSH, I'm having a rough time doing the same over HTTP.

First of all, here is the verbose git push error:

================================================================

$ GIT_CURL_VERBOSE=1 git push http://192.168.0.13/gitweb/Project master
* Couldn't find host 192.168.0.13 in the _netrc file; using defaults
* About to connect() to 192.168.0.13 port 80 (#0)
* Trying 192.168.0.13... * 0x20ab4f0 is at send pipe head!
* Connected to 192.168.0.13 (192.168.0.13) port 80 (#0)

GET /gitweb/Project/info/refs?service=git-receive-pack HTTP/1.1
User-Agent: git/1.7.4.3282.g844cb
Host: 192.168.0.13
Accept: /
Pragma: no-cache

  • The requested URL returned error: 403
  • Expire cleared
  • Closing connection #0
  • Couldn't find host 192.168.0.13 in the _netrc file; using defaults
  • About to connect() to 192.168.0.13 port 80 (#0)
  • Trying 192.168.0.13... * 0x20ab4f0 is at send pipe head!
  • Connected to 192.168.0.13 (192.168.0.13) port 80 (#0)

    GET /gitweb/Project/info/refs HTTP/1.1
    User-Agent: git/1.7.4.3282.g844cb
    Host: 192.168.0.13
    Accept: /
    Pragma: no-cache

  • The requested URL returned error: 403

  • Closing connection #0
    error: The requested URL returned error: 403 while accessing http://192.168.0.13
    /gitweb/Project/info/refs

fatal: HTTP request failed

================================================================

So there are obviously some misconfigured rights, eventhough I've temporarily chmodded my repository folder to 777.

I reckon you'll also be interested in apache's configuration:

================================================================

ServerAdmin webmaster@localhost

[...snip...]

PerlLoadModule Apache::Redmine
SetEnv GIT_PROJECT_ROOT /var/cache/git/
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/

<Location "/git/">
    DAV on
    AuthType Basic
    AuthName "Git Repository"
    Require valid-user

    PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler

    RedmineDSN "DBI:mysql:database=redmine;host=localhost"
    RedmineDbUser "redmine" 
    RedmineDbPass "XXXXXXX" 
    RedmineGitSmartHttp yes
</Location>

Alias /gitweb/ "/var/cache/git/public/"
<Location "/gitweb/">
    Order deny,allow
    Deny from all
    <Limit GET PROPFIND OPTIONS REPORT>
       Options Indexes FollowSymLinks MultiViews
       Allow from 127.0.0.1
       Allow from localhost
    </Limit>
</Location>

================================================================

So if someone would be so kind as to give me a hint about what to do, I'd really be grateful. Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

久隐师 2024-10-25 11:42:25

好的,问题解决了:)这是严格遵循的教程:

http://www .redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_for_advanced_git_integration

在我的例子中,最终条目如下所示:

PerlLoadModule Apache::Redmine

Alias /git/ "/var/cache/git/public/"
<Directory "/git/">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<Location "/git/">
    DAV on
    AuthType Basic
    AuthName "My Git Repository"
    Require valid-user

    PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler

    RedmineDSN "DBI:mysql:database=redmine;host=localhost"
    RedmineDbUser "redmine" 
    RedmineDbPass "XXXXXXX" 
    RedmineGitSmartHttp yes
</Location>

Okay, problem solved :) This is the tutorial to follow to the letter:

http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Redmine_for_advanced_git_integration

In my case, the final entry looks like:

PerlLoadModule Apache::Redmine

Alias /git/ "/var/cache/git/public/"
<Directory "/git/">
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

<Location "/git/">
    DAV on
    AuthType Basic
    AuthName "My Git Repository"
    Require valid-user

    PerlAccessHandler Apache::Authn::Redmine::access_handler
    PerlAuthenHandler Apache::Authn::Redmine::authen_handler

    RedmineDSN "DBI:mysql:database=redmine;host=localhost"
    RedmineDbUser "redmine" 
    RedmineDbPass "XXXXXXX" 
    RedmineGitSmartHttp yes
</Location>
只涨不跌 2024-10-25 11:42:25

您似乎没有使用任何身份验证。默认情况下,当使用身份验证时,git 仅允许通过 smart-http 进行推送。

您应该能够将用户名添加到您正在使用的 url 中,它会提示您输入密码,或者您可以在 _netrc 文件中设置用户名和密码。

You don't seem to be using any authentication. By default, git only allows pushing via smart-http when authentication is used.

You should be able to either add a username to the url you are using and it will prompt you for a password, or you can set the username and password in the _netrc file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文