I am trying to make gitweb work with gitolite... but unsuccessful so far.
I am working on a RedHat Linux machine. A user called git
exists.
gitolite is installed under: /home/git
Repository location: /home/git/repositories
Please note that, gitweb was working fine with plain vanilla git. Now i am trying to make it work with gitolite.
Here are what my files look like:
/etc/gitweb.conf
$projectroot = "/home/git/repositories"; @git_base_url_list = qw(ssh://[MyHostName]/home/git/projects.list); $projects_list = "/home/git/projects.list"
/home/git/projects.list
myrepo1.git myrepo2.git
/home/git/.gitolite.rc
:$PROJECTS_LIST = $ENV{HOME} . "/projects.list"; $GL_GITCONFIG_KEYS = "gitweb.url receive.denyNonFastforwards receive.denyDeletes";
What configuration have I missed? I have not made any changes to Apache.
Web URL: http://MyHostName/git
This gives a 404 error saying - No repositories found.
You need to add the Gitolite
contrib/gitweb.conf
at the end of/etc/gitweb_config.perl
.In other words, you need to call a Gitolite function from your
gitweb.conf
perl file, otherwise the integration GitWeb-Gitolite will never work.(here
repo_rights
is a method from gitolite.pm)Check the section "helping with gitweb".
The last lines you need to add at then end of
gitweb_config.perl
are:That way, you will avoid any "
500 - Internal Server Error syntax error at /etc/gitweb.conf
" error message.If you don't have a
gitweb_config.perl
in which you declaregitweb.conf.pl
, but directly "gitweb.conf.pl
", then add "use lib (".");
" as the first line of that file.I recently set up gitolite and gitweb and found that
/etc/gitweb.conf
required very little configuration. What you have looks right to me. What are the permissions like on/home/git/repositories
? You may find they are too restrictive. Try this out:That's what solved the issue for me, (though I imagine there's a more secure way to set up the permissions). If that works, I'd recommend just having a look into giving Apache (or whatever user account gitweb is being executed under) more fine-grained permissions over the repositories directory.
I also have this in my
.gitolite.rc
:so that the following works in
<gitolite-admin>/conf/gitolite.conf
:1/ install
gitolite
and set it up. Then it suffices to make sure/home/git/.gitolite.rc
contains uncommented parts that look like:2/ set correctly
$projectroot
and$projects_list
directives of/etc/gitweb.conf
(to match location ofprojects.list
file andrepositories
dir). Like:3/ Make sure current repository files are also readable by webserver user. These examples are from debian based systems, so YMMV:
4/ Finally configure access for
gitweb
user within your/conf/gitolite.conf
file ofgitolite-admin
repository on a client machine and apply them by committing and pushing them (the standard way). A repository we would like to see and manage viagitweb
has to have the access set like this:Note: The
...
only suggests there are other configuration directives within the files. Do not put them there!No other chages are necessary to make
gitlab
visualize thegitolite
repositories.Applies (at least) for
gitolite
3.6.6 andgitweb
2.1.4