3

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
hoistyler
  • 222
  • 3
  • 12
  • Not exactly an answer, but I have a working `httpd.conf` for https access with gitolite (and LDAP!) working at https://github.com/VonC/compileEverything/blob/master/apache/env.conf.tpl#L95-L132 . Maybe that can give you some clue. I don't use a wrapper and set the relevant variables directly in the `httpd.conf` file itself. – VonC Sep 06 '12 at 05:53
  • Thank for your comment VonC. I had a look at your httpd.conf section, and it is much more complicated than what I have now. I am not an expert on setting up Apache.. I have edited my original question and added more information. With your script, I couldn't figure out where I went wrong for simple http access.. – hoistyler Sep 07 '12 at 01:44

2 Answers2

1

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you very much. This gave me a good starting point! I've solved my situation now I will post what I had to do below. – hoistyler Sep 10 '12 at 01:55
1

Thanks to VonC's guidance I've now solved the problem.

I've tried git clone http://myServer/git/testing and it gave me

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

I looked into the logs, and figured out that my git.passwd file was somehow in the wrong format (I forgot how I created that file last time..)

I basically had to create my git.passwd file again:

htpasswd -c git.passwd git

Now it works! Thanks again VonC

hoistyler
  • 222
  • 3
  • 12