http和ssh的Gitolite服务器端设置

标签 git http ssh gitolite

我正在尝试使用 gitolite 设置一个 git 服务器。 到目前为止,我的服务器使用 ssh,我没有尝试在其上添加 http 支持(最终目标是使用 LDAP 进行身份验证)

我关注了 http://sitaramc.github.com/gitolite/ssh-and-http.html操作文档。

我以为我已经准备好了,所以我尝试了:

git clone http://myServer/testing

结果是:

克隆到“测试”... 致命:未找到 http://myServer/testing/info/refs:您是否在服务器上运行了 git update-server-info?

我尝试从实际的服务器测试存储库运行 git update-server-info,结果仍然相同。

testing.git 存储库中有 git-daemon-export-ok

有人可以帮我解决这个问题吗?我不确定我应该从哪里开始..

附加信息:
我正在使用 Arch Linux(服务器端)

sudo suexec -V 的输出:

-D AP_DOC_ROOT="/srv/http"
-D AP_GID_MIN=99
-D AP_HTTPD_USER="http"
-D AP_LOG_EXEC="/var/log/httpd/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=99
-D AP_USERDIR_SUFFIX="public_html"

下面是我的/etc/httpd/conf/httpd.conf 中的 VirtualHost 部分

在下面的部分中,servername 是我从hostname 命令中得到的

<VirtualHost *:80>  
    ServerName        servername  
    ServerAlias       servername
    ServerAdmin       admin@server.com

    DocumentRoot /srv/http/git  
    <Directory /srv/http/git>  
        Options       None  
        AllowOverride none  
        Order         allow,deny  
        Allow         from all  
    </Directory>  

    SuexecUserGroup git git
    ScriptAlias /git/ /srv/http/bin/gitolite-suexec-wrapper.sh/
    ScriptAlias /gitmob/ /srv/http/bin/gitolite-suexec-wrapper.sh/

    <Location /git>
        AuthType Basic
        AuthName "Git Access"
        Require valid-user
        AuthUserFile /etc/httpd/conf/extra/git.passwd
    </Location>       
</VirtualHost>

ls -l/srv/http/ 的输出

drwxr-xr-x 2 git  git  4096 Sep  6 22:02 bin
drwxr-xr-x 2 http http 4096 Sep  6 22:00 git

ls -l/srv/http/bin/gitolite-suexec-wrapper.sh 的输出

-rwx------ 1 git git 196 Sep  6 22:02 /srv/http/bin/gitolite-suexec-wrapper.sh

gitolite-suexec-wrapper.sh 的内容:

#!/bin/bash
#
# Suexec wrapper for gitolite-shell
#

export GIT_PROJECT_ROOT="/home/git/repositories"
export GITOLITE_HTTP_HOME="/home/git"

exec ${GITOLITE_HTTP_HOME}/gitolite/src/gitolite-shell

最佳答案

您的配置定义了一个别名/git/,它将调用您的 gitolite 包装器。
这意味着它只会为 yourServer/git/...

这样的地址调用它

你至少应该尝试你的克隆:

git clone http://myServer/git/testing

作为OP hoistyler this answer 中的引用资料,唯一剩下的问题是基于文件登录的身份验证。

关于http和ssh的Gitolite服务器端设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12292683/

相关文章:

来自 RESTful API 的 Django 流式传输 HTTP 响应

php - 如何使用 HTTP POST 使用 HTML 和 PHP 选择和上传多个文件?

git - 无法通过 ssh 连接到 GitLab

amazon-web-services - (google-chrome:23461):Gtk警告**:12:34:29.640:无法打开显示:

windows - 关于Windows上插件失败的 Gradle

git - 连接到 TFS 服务器关闭 Git 解决方案

git - 为什么在 git 中切换分支时会出现无法消除的差异,如何解决?

android - 如何在 Android Studio 中更改 git 分支

http - 同时读取多个 URL

linux - 内存不足时如何保持SSH打开