gpt4 book ai didi

http和ssh的Gitolite服务器端设置

转载 作者:太空狗 更新时间:2023-10-29 14:15:26 26 4
gpt4 key购买 nike

我正在尝试使用 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com