Question

this is a topic you find realy often. However, I tried everything since 2 days and I'm running out of ideas. Hope someone can help me here.

In general I did the following:

  • apt-get install gitolite gitweb
  • added repos to gitolite.conf (see below)
  • added user www-data to group gitolite
  • created projects.list manually (see below)
  • set symlink /var/www/gitweb -> /usr/share/gitweb
  • set up gitweb vhost (see below)

When I now browse to http://git.example.org I see gitweb with the message "404 - No projects found". There is no error message in the log file.

1) Gitolite directory:

drwxr-xr-x  5 gitolite gitolite 4096 Mai  6 20:03 .
drwxr-xr-x 43 root     root     4096 Mai  6 18:12 ..
drwxr-x---  8 gitolite gitolite 4096 Mai  6 18:12 .gitolite
-rw-r-xr--  1 gitolite gitolite 4217 Mai  6 19:43 .gitolite.rc.new
-rwxr-xr-x  1 gitolite gitolite   25 Mai  6 19:59 projects.list
drwxr-xr-x  6 gitolite gitolite 4096 Mai  6 18:14 repositories
drwxr-x---  2 gitolite gitolite 4096 Mai  6 18:14 .ssh

2) gitolite.conf

repo    gitolite-admin
        RW+ = admin

repo    repo1
        RW+ = admin
        R   = @all

repo    repo2
        RW+ = admin
        R   = @all

3) .gitolite.rc.new (Why is here .new appended? Installed gitolite with apt-get install gitolite)

# ------------------------------------------------------------------------------
# DO NOT TOUCH THIS SECTION!
# ------------------------------------------------------------------------------

$GL_ADMINDIR=$ENV{HOME} . "/.gitolite";
$GL_CONF="$GL_ADMINDIR/conf/gitolite.conf";
$GL_KEYDIR="$GL_ADMINDIR/keydir";
$GL_CONF_COMPILED="$GL_ADMINDIR/conf/gitolite.conf-compiled.pm";

# DO NOT CHANGE THE NEXT FOUR LINES UNLESS YOU REALLY KNOW WHAT YOU'RE DOING.
# These variables are set automatically by the install method you choose.
#            (PACKAGE MAINTAINERS: PLEASE READ doc/packaging.mkd)
$GL_PACKAGE_CONF = "/usr/share/gitolite/conf";
$GL_PACKAGE_HOOKS = "/usr/share/gitolite/hooks";

# ------------------------------------------------------------------------------
# most often used/changed variables
# ------------------------------------------------------------------------------
$GL_WILDREPOS = 0;
$PROJECTS_LIST = $ENV{HOME} . "/projects.list";
# $WEB_INTERFACE = "gitweb";
# $GITWEB_URI_ESCAPE = 0;
$REPO_UMASK = 0022;

4) /var/lib/gitolite/projects.list

repo1.git
repo2.git

5) /var/lib/gitolite/repositories

drwxr-xr-x 7 gitolite gitolite 4096 Mai  6 18:14 repo1.git
drwxr-xr-x 7 gitolite gitolite 4096 Mai  6 18:14 repo1.git

6) gitweb vhost:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName git.example.org

    SetEnv GITWEB_CONFIG   /etc/gitweb.conf
    SetEnv GIT_PROJECT_ROOT /var/lib/gitolite/repositories

    DocumentRoot /var/www/gitweb

    <Directory /var/www/gitweb>
      Options FollowSymLinks ExecCGI
      AllowOverride All
      order allow,deny
      Allow from all
      AddHandler cgi-script .cgi

      DirectoryIndex index.cgi

      # Pretty gitweb URLs
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^.* /index.cgi/$0 [L,PT]
    </Directory>

    # Enable git clone over HTTP
    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/lib/git-core/git-http-backend/$1

    ErrorLog /var/log/apache2/git-error.log
    CustomLog /var/log/apache2/git-access.log combined
</VirtualHost>

7) /etc/gitweb.conf

# path to git projects (<project>.git)
$projectroot = "/var/lib/gitolite/repositories";

@git_base_url_list = ("git://git.example.org", "http://git.example.org");

$site_name = "git.example.com";

# require export flag
$export_ok = "git-daemon-export-ok";
$strict_export = 1;

# directory to use for temp files
$git_temp = "/tmp";

# target of the home link on top of all pages
#$home_link = $my_uri || "/";

# html text to include at home page
#$home_text = "indextext.html";

# file with project list; by default, simply scan the projectroot dir.
$projects_list = "/var/lib/gitolite/projects.list";

# stylesheet to use
#@stylesheets = ("static/gitweb.css");

# javascript code for gitweb
#$javascript = "static/gitweb.js";

# logo to use
#$logo = "static/git-logo.png";

# the 'favicon'
#$favicon = "static/git-favicon.png";

# git-diff-tree(1) options to use for generated patches
#@diff_opts = ("-M");
@diff_opts = ();

Thank you very much!

Was it helpful?

Solution

Just for sake of completeness - my answer from May 6 2013 :-)

It's all for gitolite v2:

I got it finally working: First added "gitweb daemon" to all R's in gitolite.conf and second added "SetEnv GIT_HTTP_BACKEND /usr/lib/git-core/git-http-backend" to vhost file. Don't know if both changes are necessary though.

OTHER TIPS

In my case it was simply a problem of permission to /home/gitolite/repositories/ directory.

Or it can be problem with umask settings – according to DOC default umask is 0700, for cgit / gitweb works 0027.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top