Gitweb在Ubuntu上的配置


首先安装:

$ sudo apt-get install gitweb

gitweb.cgi 脚本安装在 /usr/lib/cgi-bin/ 中,该目录为默认 Ubuntu 上 apache2 的 cgi-bin 目录。所以,打开:

http://localhost/cgi-bin/gitweb.cgi

默认没有 css 加载,把 gitweb 要用的静态文件连接到 DocumentRoot 下:

$ cd /var/www/
$ sudo ln -s /usr/share/gitweb/* .

修改配置:

$ sudo vi /etc/gitweb.conf

将 $projectroot 改为存放各个 .git 的目录。保存后刷新浏览器。
Related Posts

如果没有找到项目,你需要将projectroot/*.git 的属性改为755,让apache用户有可读权限。可以只改你需要让别人通过web访问的那个git。
http://localhost/cgi-bin/gitweb.cgi


/etc/gitweb.conf 内容:
# path to git projects (<project>.git)
$projectroot = "/var/git/repositories";

# 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 = $projectroot;

# stylesheet to use
$stylesheet = "/gitweb/gitweb.css";

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

# the 'favicon'

$favicon = "/gitweb/git-favicon.png";

相关内容