threads / discuss / 24092

(osx 10.4.11) can't push from linux to Apache on mac: can't access location

Subject: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

## tl;dr

9 messages between Jun 13, 2010 and Jun 17, 2010.

replies: 8people: 4as markdown or json

ddw_music· Jun 13, 2010, 00:48 UTC · lore

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

-- 
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.
Tay Ray Chuan· Jun 13, 2010, 05:23 UTC · re: ddw_music · lore

Re: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

On Sun, Jun 13, 2010 at 8:48 AM, ddw_music <jamshark70@gmail.com> wrote:
Show 20 quoted lines
>[snip]
>
> 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

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.
-- 
Cheers,
Ray Chuan
ddw_music· Jun 13, 2010, 06:35 UTC · re: Tay Ray Chuan · lore

Re: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

Tay Ray Chuan wrote:
> 
> 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

-- 
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.
Tay Ray Chuan· Jun 13, 2010, 07:20 UTC · re: ddw_music · lore

Re: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

Hi,
On Sun, Jun 13, 2010 at 2:35 PM, ddw_music <jamshark70@gmail.com> wrote:
> 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/
  > discover info/refs
  <bla bla: look for the lock token>
  > unlock <token>
Sorry if this looks vague - I don't have access to a DAV server.
-- 
Cheers,
Ray Chuan
ddw_music· Jun 13, 2010, 10:28 UTC · re: Tay Ray Chuan · lore

Re: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

Tay Ray Chuan wrote:
Show 10 quoted lines
> 
> I vaguely remember encountering this. Use a dav client, like cadaver,
> to manually release the lock.
> 
>   $ cadaver http://yourserver/git/kc/
>   > discover info/refs
> 
>   <bla bla: look for the lock token>
>   > 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

-- 
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.
Jakub Narebski· Jun 13, 2010, 10:44 UTC · re: ddw_music · lore

Re: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

ddw_music <jamshark70@gmail.com> writes:
Show 24 quoted lines
> Tay Ray Chuan wrote:
> > 
> > I vaguely remember encountering this. Use a dav client, like cadaver,
> > to manually release the lock.
> > 
> >   $ cadaver http://yourserver/git/kc/
> >   > discover info/refs
> > 
> >   <bla bla: look for the lock token>
> >   > 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.

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?
-- 
Jakub Narebski
Poland
ShadeHawk on #git
ddw_music· Jun 13, 2010, 11:56 UTC · re: Jakub Narebski · lore

Re: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

Jakub Narebski wrote:
Show 6 quoted lines
> 
> 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.

> 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
-- 
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.
Jakub Narebski· Jun 13, 2010, 12:38 UTC · re: ddw_music · lore

Re: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

ddw_music <jamshark70@gmail.com> writes:
Show 12 quoted lines
> Jakub Narebski wrote:
> > 
> > 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.)

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...

Show 10 quoted 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).
-- 
Jakub Narebski
Poland
ShadeHawk on #git
mobi phil· Jun 17, 2010, 22:26 UTC · re: Tay Ray Chuan · lore

Re: (osx 10.4.11) can't push from linux to Apache on mac: can't access location

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

← back to recent threads