3

gitolite を使用して git サーバーをセットアップしようとしています。これまでのところ、サーバーは ssh で動作しており、その上に http サポートを追加しようとはしていません (最終的な目標は、認証に LDAP を使用することです)。

http://sitaramc.github.com/gitolite/ssh-and-http.htmlハウツー ドキュメントに従いました 。

私はそれをすべてセットアップしたと思ったので、試しました:

git clone http://myServer/testing

結果は次のとおりです。

Cloning into 'testing'... fatal: http://myServer/testing/info/refs not found: did you run git update-server-info on the server?

git update-server-info実際のサーバー テスト リポジトリから実行してみましたが、結果は同じです。

git-daemon-export-oktesting.git リポジトリにあります。

誰かがこの問題を解決するのを手伝ってくれませんか? どこから始めればいいのかわからない..

追加情報:
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
4

2 に答える 2

1

設定では、gitoliteラッパーを呼び出すエイリアス/git/を定義します。
つまり、次のようなアドレスに対してのみ呼び出すということです。yourServer/git/...

少なくとも次の方法でクローンを試す必要があります。

git clone http://myServer/git/testing

この回答でOPホイスティラーが参照しているように、残っている唯一の問題は、ファイルベースのログインに基づく認証の問題でした。

于 2012-09-07T04:11:27.713 に答える
1

VonC のガイダンスのおかげで、問題は解決しました。

私は試してみましたがgit clone http://myServer/git/testing、それは私に与えました

Cloning into 'testing'...
Username for 'http://myServer': git
Password for 'http://git@myServer': 
fatal: Authentication failed

ログを調べたところ、git.passwd ファイルの形式が間違っていることがわかりました (前回、そのファイルをどのように作成したか忘れてしまいました..)

基本的に、git.passwd ファイルを再度作成する必要がありました。

htpasswd -c git.passwd git

今それは動作します!ありがとうございます

于 2012-09-10T02:03:13.930 に答える