用于http和ssh的Gitolite服务器端设置 [英] Gitolite server-side setup for both http and ssh
问题描述
我正在尝试使用gitolite设置git服务器。
到目前为止,我有服务器与ssh协同工作,我不想在其上添加http支持(最终目标是使用LDAP进行身份验证)。
我已遵循
http://sitaramc.github。 com / gitolite / ssh-and-http.html how-to document。
我想我已经完成了所有设置,所以我试过了:
git clone http:// myServer / testing
并且结果是:
克隆到'testing'中...
致命的:http:// myServer / testing / info / refs not found:你是否在服务器上运行git update-server-info?
我试过运行 git update-server-info
从实际的服务器测试存储库中,仍然是相同的结果。
有 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是我从
< VirtualHost *:80>
ServerName servername
ServerAlias servername
ServerAdmin admin@server.com
DocumentRoot / srv / http / git
< Directory / srv / http / git> ;
选项无
AllowOverride无
允许,拒绝
允许所有
< / 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
AuthNameGit Access
需要有效用户
AuthUserFile /etc/httpd/conf/extra/git.passwd
< / VirtualHost>
从 ls -l / srv / http / $ c
$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ 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
:
$ g
$ b export GITOLITE_HTTP_HOME =/ home / git
exec $ {GITOLITE_HTTP_HOME} / gitolite / src / gitolite-shell
您的配置定义了一个别名/ git /,它将调用您的gitolite包装。
这意味着它会调用它仅适用于像 yourServer / git /...$ c $这样的地址
你应该至少试试你的克隆:
git clone http:// myServer / git / testing
由于OP hoistyler 在此答案中引用,唯一剩下的问题是基于基于文件的登录身份验证。
I am trying to set-up a git server using gitolite. So far, I have the server working with the ssh and I am not trying to add http support on top of it (final goal is to use LDAP for authentication)
I've followed http://sitaramc.github.com/gitolite/ssh-and-http.html how-to document.
I thought I had it all set-up so I tried:
git clone http://myServer/testing
and the result is:
Cloning into 'testing'...
fatal: http://myServer/testing/info/refs not found: did you run git update-server-info on the server?
I've tried running git update-server-info
from the actual server testing repository, and still the same result.
There is git-daemon-export-ok
on the testing.git repository.
Could someone please help me solve this issue? I am not sure where I should begin..
Additional Information:
I am using Arch Linux (server side)
output from 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"
below is my VirtualHost section in my /etc/httpd/conf/httpd.conf
in the below section, servername is what I get from hostname
command
<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>
output from 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
output from 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
content of the 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
Your config defines an alias /git/ which will call your gitolite wrapper.
That means it will call it only for addresses like yourServer/git/...
You should at least try your clone with:
git clone http://myServer/git/testing
As the OP hoistyler references in this answer, the only remaining issue was an authentication one based on a file-based login.
这篇关于用于http和ssh的Gitolite服务器端设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!