我在Mac OsX上,试图托pipe我自己的git服务器。 我有gitolite完美运行。
不过,我在我的Sites目录中有一个名为“ git ”的文件夹,因此访问http://git.example.com指向该目录。
我怎样才能让Gitweb的文档根目录指向我在/Users/me/repositories/ gitolite“ repositories ”文件夹?
你需要添加一个gitweb.conf.pl文件(比如这个) :
export_auth_hook子, gitweb.cgi调用它) 这将包括:
$ENV{GL_REPO_BASE_ABS} = "$ENV{HOME}/repositories"; $export_auth_hook = sub { my $repo = shift; my $user = $ENV{GL_USER}; # gitweb passes us the full repo path; so we strip the beginning # and the end, to get the repo name as it is specified in gitolite conf return unless $repo =~ s/^\Q$projectroot\E\/?(.+)\.git$/$1/; # check for (at least) "R" permission my $ret = &access( $repo, $user, 'R', 'any' ); my $res = $ret !~ /DENIED/; return ($ret !~ /DENIED/); };
access()是gitolite/src/lib/Gitolite/Conf/Load.pm 。
然后你的httpd.conf将会调用这个gitweb.cgi脚本。
由于我错过了我的project.list,我自己创build了它。 然后我chmod -r 755整个存储库目录。 现在工作!