Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8428699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:07:38+00:00 2026-06-10T05:07:38+00:00

I’m running gitweb and gitolite on my server: http://git.jshawl.com/ I’m having trouble setting up

  • 0

I’m running gitweb and gitolite on my server: http://git.jshawl.com/

I’m having trouble setting up the git-http-backend to allow anonymous cloning.

Here’s what my vhosts file (/etc/apache2/extra/httpd-vhosts.conf) looks like:

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

`

I followed the directions here: http://www.kernel.org/pub/software/scm/git/docs/git-http-backend.html, but am consistently confronted with that 502 error.

My apache error log says: [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

Also, adding all of this has taken down my gitweb installation (which used to be at http://git.jshawl.com)

What am I doing wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:07:40+00:00Added an answer on June 10, 2026 at 5:07 am

    Here is another approach in this httpd.conf which works well for cloning/pushing/pulling, but it doesn’t call gitweb.cgi:

    GitWeb is for browsing, not for cloning

    (small extract, removing Auth details, and SSL details)

    # GitHttp on @PORT_HTTP_HGIT@
    Listen @PORT_HTTP_HGIT@
    <VirtualHost @FQN@:@PORT_HTTP_HGIT@>
      ServerName @FQN@
      ServerAlias @HOSTNAME@
      SetEnv GIT_PROJECT_ROOT @H@/repositories
      SetEnv GIT_HTTP_EXPORT_ALL
      SetEnv GITOLITE_HTTP_HOME @H@
      ScriptAlias /hgit/ @H@/gitolite/bin/gitolite-shell/
      SetEnv GIT_HTTP_BACKEND "@H@/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>
    

    In other words:

    • git-http-backend is referenced by the variable GIT_HTTP_BACKEND, but you won’t need it if you are using Gitolite V3.
    • gitolite-shell is called when you are using /hgit/ in your cloning address: theat GitoliteV3 script will check if you have the right to clone the repo, and if yes, will call the commands behind the script git-http-backend: ‘git-receive-pack‘ (for push) or ‘git-upload-pack‘ (for clone/pull/fetch), straight from the git source itself http-backend.c.

    So:

    git clone https://yourServer/hgit/yourRepo
    

    Will call gitolite, which will call ‘git-receive-pack‘ or ‘git-upload-pack‘.
    It will first analyze the http request by calling 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}";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.