(osx 10.4.11) can't push from linux to Apache on mac: can't access location
Apologies if this has been covered in the past -- I searched the nabble archives but didn't find the answer.
I'm new to git, and wanted to synchronize repositories between my main machine (OSX 10.4.11) and satellite net book (puredyne 9.10, based on ubuntu karmic). I've gotten as far as being able to get the directory listing in Firefox on the Mac (same machine where Apache is running) at
http://ip.address/~username/git/kc ('git/kc' is the bare repository under ~/Sites/).
I tried to follow the directions in setup-git-server-over-http.txt:
- added at the end of the load module section of httpd.conf:
LoadModule dav_module libexec/httpd/libdav.so
- added at the end of the add module section of httpd.conf:
AddModule mod_dav.c
- added at the end of the file, just above the final "include":
DAVLockDB "/usr/local/apache2/temp/DAV.lock"
<Location /git/kc>
DAV on
AuthType Basic
AuthName "Git"
AuthUserFile /usr/local/apache2/conf/passwd.git Require valid-user
</Location>
- chmod -R ugo+w ~/Sites/git
git clone works.
git push... fails. The remote machine says that it couldn't access the location. Apache's access log shows:
"PROPFIND /~dewdrop/git/kc/ HTTP/1.1" 404 288
404? The folder most certainly exists.
Anyway, I'm confused. I'm not an expert in Web server configuration, would appreciate some advice.
Thanks!
James
Signature · 2 lines
View this message in context: http://git.661346.n2.nabble.com/osx-10-4-11-can-t-push-from-linux-to-Apache-on-mac-can-t-access-location-tp5173157p5173157.html Sent from the git mailing list archive at Nabble.com.
Quoted 12 lines · ddw_music
[snip]
DAVLockDB "
/usr/local/apache2/temp/DAV.lock"<Location /git/kc>
DAV on
AuthType Basic
AuthName "Git"
AuthUserFile/usr/local/apache2/conf/passwd.gitRequire valid-user
</Location>
Quoted 8 lines
- chmod -R ugo+w ~/Sites/git
git clone works.
git push... fails. The remote machine says that it couldn't access the location. Apache's access log shows:
"PROPFIND /~dewdrop/git/kc/ HTTP/1.1" 404 288
Where are you pushing to? Look at your <Location> again - you configured Apache to look out for '/git/kc/', not '/~dewdrop/git/kc/'.
I'm assuming the <Location> isn't nested in something else, that is.
Signature · 2 lines
Cheers, Ray Chuan
Quoted 4 lines · Tay Ray Chuan
Where are you pushing to? Look at your <Location> again - you configured Apache to look out for '/git/kc/', not '/~dewdrop/git/kc/'.
Ah... of course. Now I do get the directory listing of the repository on the remote machine.
Still a problem pushing, though: the famous "cannot lock existing info/refs" message. I see a reference on a Google group -- a problem/solution post* -- but that's inaccessible to me from mainland China. Likely to be something simple, but I have actual work that I need to get back to at the moment :-)
* groups.google.com/group/.../0792d1750d764225
Thanks for further advice.
James
Signature · 2 lines
View this message in context: http://git.661346.n2.nabble.com/osx-10-4-11-can-t-push-from-linux-to-Apache-on-mac-can-t-access-location-tp5173157p5173593.html Sent from the git mailing list archive at Nabble.com.
Hi,
Quoted 4 lines · ddw_music
Still a problem pushing, though: the famous "cannot lock existing info/refs" message. I see a reference on a Google group -- a problem/solution post* -- but that's inaccessible to me from mainland China. Likely to be something simple, but I have actual work that I need to get back to at the moment :-)
I vaguely remember encountering this. Use a dav client, like cadaver, to manually release the lock.
$ cadaver http://yourserver/git/kc/
Quoted 1 line
discover info/refs
<bla bla: look for the lock token>
Quoted 1 line
unlock <token>
Sorry if this looks vague - I don't have access to a DAV server.
Signature · 2 lines
Cheers, Ray Chuan
Quoted 10 lines · Tay Ray Chuan
I vaguely remember encountering this. Use a dav client, like cadaver, to manually release the lock.
$ cadaver http://yourserver/git/kc/Quoted 1 line
discover info/refs
<bla bla: look for the lock token>
Quoted 1 line
unlock <token>
I do appreciate the help... unfortunately, cadaver reports no locks but the error persists...
For my purposes, I think I can use git-daemon. It's approaching the point where it will not be worth dealing with the Apache layer. Unless there is a simple solution, the HTTP approach seems to be adding complexity without much benefit.
If anyone out there knows of a straightforward way to set this up, I'm eager to hear it. (By "straightforward," I mean I'm out of time to fiddle around with it much more.) If there is no straightforward way, git-daemon it will be for me.
Thanks.
James
Signature · 2 lines
View this message in context: http://git.661346.n2.nabble.com/osx-10-4-11-can-t-push-from-linux-to-Apache-on-mac-can-t-access-location-tp5173157p5173934.html Sent from the git mailing list archive at Nabble.com.
Quoted 20 lines · ddw_music
Quoted 10 lines · Tay Ray Chuan
I vaguely remember encountering this. Use a dav client, like cadaver, to manually release the lock.
$ cadaver http://yourserver/git/kc/Quoted 1 line
discover info/refs
<bla bla: look for the lock token>
Quoted 1 line
unlock <token>
I do appreciate the help... unfortunately, cadaver reports no locks but the error persists...
For my purposes, I think I can use git-daemon. It's approaching the point where it will not be worth dealing with the Apache layer. Unless there is a simple solution, the HTTP approach seems to be adding complexity without much benefit.
Quoted 4 lines
If anyone out there knows of a straightforward way to set this up, I'm eager to hear it. (By "straightforward," I mean I'm out of time to fiddle around with it much more.) If there is no straightforward way, git-daemon it will be for me.
Why can't you use SSH for pushing instead of "dumb" HTTPS via WebDAV? This would require having sshd (SSH daemon, i.e. SSH server) installed, and perhaps Gitosis or Gitolite for access control (so one can use only single shell account).
git-daemon in default configuration doesn't allow pushing.
I don't know if new "smart" HTTP has support for pushing, and whether it would be easier to set up than WebDAV..
P.S. You did run git-update-server-info (and added it to 'update'
hook), didn't you?
Signature · 3 lines
Jakub Narebski Poland ShadeHawk on #git
Quoted 6 lines · Jakub Narebski
Why can't you use SSH for pushing instead of "dumb" HTTPS via WebDAV? This would require having sshd (SSH daemon, i.e. SSH server) installed, and perhaps Gitosis or Gitolite for access control (so one can use only single shell account).
I'll consider that later on. For the moment -- I spent probably five or six hours today and fiddling around with the configuration, and I don't have time to look at any other tools (gitosis etc). (At least osx comes with "Remote Login" == sshd preinstalled.)
While experimenting with git-daemon this morning, I did get the functionality that I need working by enabling receive-pack. Yes, I know that's a security risk, but I'm the only user, behind a hardware router (no exposed IP address) and I will have the daemon running only for a few minutes at a time when needed for sync.
I realize this isn't the "correct" or "optimal" configuration, but I know that it will work for the moment and, as stated, I simply won't have any further time for experimentation for the next few weeks.
Quoted 3 lines
P.S. You did run git-update-server-info (and added it to 'update' hook), didn't you?
Yes, no help.
Thanks, in any case - it's a good tip for the future (and word to the wise to git noobs who find this in the list archives: avoid HTTP!).
James
Signature · 2 lines
View this message in context: http://git.661346.n2.nabble.com/osx-10-4-11-can-t-push-from-linux-to-Apache-on-mac-can-t-access-location-tp5173157p5174101.html Sent from the git mailing list archive at Nabble.com.
Quoted 8 lines · ddw_music
Quoted 6 lines · Jakub Narebski
Why can't you use SSH for pushing instead of "dumb" HTTPS via WebDAV? This would require having sshd (SSH daemon, i.e. SSH server) installed, and perhaps Gitosis or Gitolite for access control (so one can use only single shell account).
Quoted 4 lines
I'll consider that later on. For the moment -- I spent probably five or six hours today and fiddling around with the configuration, and I don't have time to look at any other tools (gitosis etc). (At least osx comes with "Remote Login" == sshd preinstalled.)
Gitosis / Gitolite would be needed only if there are many people that you want to have SSH access to git repositories without giving them all shell access...
Quoted 10 lines
While experimenting with git-daemon this morning, I did get the functionality that I need working by enabling receive-pack. Yes, I know that's a security risk, but I'm the only user, behind a hardware router (no exposed IP address) and I will have the daemon running only for a few minutes at a time when needed for sync.
I realize this isn't the "correct" or "optimal" configuration, but I know that it will work for the moment and, as stated, I simply won't have any further time for experimentation for the next few weeks.
...but in your situation it would be anough to have on server (i.e. on computer you want to push to) to have sshd and git installed, and have sshd enabled (turned on) and git available in your $PATH on server.
Then
git push <user>@<host>:/path/to/repo.git <branch>
should work (or you can configure remote).
Signature · 3 lines
Jakub Narebski Poland ShadeHawk on #git
was here to report something, and found the post... maybe the following article can help you:
http://www.mobiphil.com/2010/03/git-on-shared-hosting-with-git-http-backend/#comment-11347
regards