1

I am trying to configure gitolite to work on nginx with gitweb. And despite gitweb working flawlessly and recognizing all the access control functionality provided by gitolite, I can't seem to be able to access the repos themselves over http. For example, when I try to fetch a repo, I get:

user@hostname:$ git fetch origin master Username for 'http://git.<hostname>': <Username> Password for 'http://<Username>@git.<hostname>': remote: An error occurred while reading CGI reply (no response received) fatal: unable to access 'http://git.<hostname>/git/<reponame>.git/': The requested URL returned error: 502

My current nginx config looks like this:

server {
    listen 127.0.0.1:80;

    server_name git.<hostname>;
    root /usr/share/gitweb;

    # Basic Authentication
    auth_basic "Private Git Server";
    auth_basic_user_file /srv/etc/.htpasswd;

    location ~ /git(/.*) {
    root /srv/git/;

    client_max_body_size 0;

    # fcgiwrap is set up to listen on this host:port
    include       fastcgi_params;
    fastcgi_param SCRIPT_FILENAME    /srv/git/gitolite-source/src/gitolite-shell;

    # export all repositories under GIT_PROJECT_ROOT
    fastcgi_param REMOTE_USER $remote_user;
    fastcgi_param GIT_HTTP_EXPORT_ALL "";
    fastcgi_param GIT_PROJECT_ROOT    /srv/http/repositories;
    fastcgi_param GITOLITE_HTTP_HOME /srv/git;
    fastcgi_param PATH_INFO           $1;
    fastcgi_pass    unix:/var/run/fcgiwrap.sock;
    }

    try_files $uri @gitweb;
    location @gitweb {
    fastcgi_pass unix:/var/run/fcgiwrap.sock;
    fastcgi_param SCRIPT_FILENAME   /usr/share/gitweb/gitweb.cgi;
    fastcgi_param PATH_INFO         $uri;
    fastcgi_param REMOTE_USER $remote_user;
    fastcgi_param GITWEB_CONFIG     /srv/git/gitweb/gitweb.conf;
    include fastcgi_params;
    }
}

Gitolite is installed in /srv/git and all the repositories (along with gitolite config files and etc) are stored in /srv/http (running gitolite under http user). I suspect it's a miscofiguration issue. What do I need to do to make it possible to operate git over http with my current setup? I use Arch, btw

Anon34623
  • 21
  • 6

1 Answers1

1

Well, the solution was just 1 step away. GITOLITE_HTTP_HOME parameter just needs to point to /srv/http; instead of /srv/git;. And that's it. Both gitweb and git function perfectly and respect the permissions set in gitolite.conf.

Anon34623
  • 21
  • 6