Hi,
I am trying to setup Apache on my git server and authenticated pull / push. 
I realise there are loads of hosting services that do this for me but I 
would like to do it myself.
There is not a lot of information on this in books but I have found several 
tutorials and the git-http-backend man pages. But I am really looking for 
step by step instructions that work.
So ...
I have switched on httpd on a centos6.4 VM. On this machine are a few bare 
git repositories.
 
[vobadm@centos64 git_repos]$ pwd
/opt/git_repos
[vobadm@centos64 git_repos]$ ls -l
total 20
drwxrwxrwx. 7 vobadm users 4096 Oct  9 17:53 csg2.git
drwxrwsr-x. 7 vobadm users 4096 Jan 30  2013 dev_maven.git
-rw-r--r--. 1 vobadm users   47 Oct  9 13:42 groups
drwxrwxrwx. 7 vobadm users 4096 Sep  9 09:39 norriquest.git
-rw-r--r--. 1 vobadm users   43 Oct  9 13:41 passwords
[vobadm@centos64 git_repos]$ 
The two of interest are csg2.git and norriquest.git.

In httpd.conf, I have
 
ScriptAlias /git/ "/usr/libexec/git-core/git-http-backend/"
 
SetEnv GIT_PROJECT_ROOT "/opt/git_repos"
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
#<Directory "/opt/git_repos">
#       Options None
#       AllowOverride None
#       Order allow,deny
#       Allow from all
#</Directory>
 

# Only required if you are using repository level permissions
 <Location /csg2.git>
        AuthType Basic
        AuthName "New Repo Access"
        AuthUserFile /opt/git_repos/passwords
        AuthGroupFile /opt/git_repos/groups
        Require group csg2
 </Location>
I commented out the directory part to see if that made a difference - after 
an apache restart - it did not.

In the groups file is
[vobadm@centos64 git_repos]$ cat groups
csg2: jnorris
csg2: vobadm
norriquest: vobadm
 
Then on my PC, as jnorris (group HomeUsers)
 
C:\GitWork>git clone *http://centos64/git/csg2.git* 
<http://centos64/git/csg2.git> http_csg2
Cloning into 'http_csg2'...
remote: Counting objects: 95, done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 95 (delta 39), reused 95 (delta 39)
Unpacking objects: 100% (95/95), done.
Checking connectivity... done.
 
C:\GitWork\http_csg2\csg2>echo "johnny" > test.txt
 
C:\GitWork\http_csg2\csg2>git add test.txt
 
C:\GitWork\http_csg2\csg2>git commit -m "added text file"
[master 44b91da] added text file
 1 file changed, 1 insertion(+)
 create mode 100644 csg2/test.txt
 
C:\GitWork\http_csg2\csg2>git log
commit 44b91da91a841bff6789a7e7c102ec8324a1ce09
Author: John
Date:   Thu Oct 9 18:14:42 2014 +0100
 
    added text file
C:\GitWork\http_csg2\csg2>git remote -v
origin  *http://centos64/git/csg2.git* <http://centos64/git/csg2.git> 
(fetch)
origin  *http://centos64/git/csg2.git* <http://centos64/git/csg2.git> (push)
 
C:\GitWork\http_csg2\csg2>git push
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 325 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
error: unpack failed: unpack-objects abnormal exit
To *http://centos64/git/csg2.git* <http://centos64/git/csg2.git>
 ! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to '*http://centos64/git/csg2.git* 
<http://centos64/git/csg2.git>'

So, what have I done wrong? I am not asked for any authentication and yet I 
believe I have set up apache for authentication on both read and write.
>From what I can discover the unpacker error suggests that there is a 
corruption in bare git and it needs a git repack but that has not helped.

Regards,
John

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to