git-http-backend devuelve el error 502

Estoy ejecutando gitweb y gitolite en mi server: http://git.jshawl.com/

Tengo problemas para configurar git-http-backend para permitir la clonación anónima.

Esto es lo que mi file de vhosts ( /etc/apache2/extra/httpd-vhosts.conf ) tiene el siguiente aspecto:

 <VirtualHost *:80> DocumentRoot "/Users/git/repositories" ServerName git.jshawl.com <Directory "/Users/git/repositories"> Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All order allow,deny Allow from all AddHandler cgi-script cgi DirectoryIndex gitweb.cgi </Directory> <LocationMatch "^/.*/git-receive-pack$"> AuthType Basic AuthName "Git Access" Require group committers </LocationMatch SetEnv GIT_PROJECT_ROOT /Users/git/repositories SetEnv GIT_HTTP_EXPORT_ALL ScriptAliasMatch \ "(?x)^/(.*/(HEAD | \ info/refs | \ objects/(info/[^/]+ | \ [0-9a-f]{2}/[0-9a-f]{38} | \ pack/pack-[0-9a-f]{40}\.(pack|idx)) | \ git-(upload|receive)-pack))$" \ /usr/libexec/git-core/git-http-backend/$1 ScriptAlias / /Users/git/repositories/gitweb.cgi/ 

`

Seguí las instrucciones aquí: http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html , pero estoy constantemente confrontado con el error 502.

Mi logging de error de apache dice: [Fri Aug 24 19:29:32 2012] [error] [client 198.228.200.148] client denied by server configuration: /usr/libexec/git-core/git-http-backend

Además, agregar todo esto ha eliminado mi installation de gitweb (que solía estar en http://git.jshawl.com )

¿Qué estoy haciendo mal?

Aquí hay otro enfoque en este httpd.conf que funciona bien para clonar / empujar / tirar, pero no llama a gitweb.cgi :

GitWeb es para navegar, no para clonar

(pequeño extracto, eliminación de detalles de authentication y detalles de SSL)

 # GitHttp on @[email protected] Listen @[email protected] <VirtualHost @[email protected]:@[email protected]> ServerName @[email protected] ServerAlias @HOSTNA[email protected] SetEnv GIT_PROJECT_ROOT @[email protected]/repositories SetEnv GIT_HTTP_EXPORT_ALL SetEnv GITOLITE_HTTP_HOME @[email protected] ScriptAlias /hgit/ @[email protected]/gitolite/bin/gitolite-shell/ SetEnv GIT_HTTP_BACKEND "@[email protected]/usr/local/apps/git/libexec/git-core/git-http-backend" <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Location /hgit> AddHandler cgi-script cgi </Location> </VirtualHost> 

En otras palabras:

  • git-http-backend es referencedo por la variable GIT_HTTP_BACKEND , pero no lo necesitará si está usando Gitolite V3 .
  • gitolite-shell cuando usa /hgit/ en su dirección de clonación: el script theat GitoliteV3 verificará si tiene derecho a clonar el repository, y si es así, invocará los commands detrás del guión git-http-backend : ' git-receive-pack '(para push) o' git-upload-pack '(para clon / pull / fetch), directamente de la fuente de git http-backend.c .

Asi que:

 git clone https://yourServer/hgit/yourRepo 

Llamará a gitolite, que llamará ' git-receive-pack ' o ' git-upload-pack '.
Primero analizará la request http llamando a la sub http_simulate_ssh_connection()

 sub http_simulate_ssh_connection { # these patterns indicate normal git usage; see "services[]" in # http-backend.c for how I got that. Also note that "info" is overloaded; # git uses "info/refs...", while gitolite uses "info" or "info?...". So # there's a "/" after info in the list below if ( $ENV{PATH_INFO} =~ m(^/(.*)/(HEAD$|info/refs$|objects/|git-(?:upload|receive)-pack$)) ) { my $repo = $1; my $verb = ( $ENV{REQUEST_URI} =~ /git-receive-pack/ ) ? 'git-receive-pack' : 'git-upload-pack'; $ENV{SSH_ORIGINAL_COMMAND} = "$verb '$repo'"; } else { # this is one of our custom commands; could be anything really, # because of the adc feature my ($verb) = ( $ENV{PATH_INFO} =~ m(^/(\S+)) ); my $args = $ENV{QUERY_STRING}; $args =~ s/\+/ /g; $args =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; $ENV{SSH_ORIGINAL_COMMAND} = $verb; $ENV{SSH_ORIGINAL_COMMAND} .= " $args" if $args; http_print_headers(); # in preparation for the eventual output! } $ENV{SSH_CONNECTION} = "$ENV{REMOTE_ADDR} $ENV{REMOTE_PORT} $ENV{SERVER_ADDR} $ENV{SERVER_PORT}"; }