http://git.kernel.org
Figure 4-1. 基于网页的 GitWeb 用户界面
lighttpd
或 webrick
这样轻量级的服务器启动一个临时进程。如果是在 Linux 主机上,通常都预装了 lighttpd
,可以到项目目录中键入 git instaweb
来启动。如果用的是 Mac ,Leopard 预装了 Ruby,所以 webrick
应该是最好的选择。如果要用 lighttpd 以外的程序来启动 git instaweb
,可以通过 --httpd
$ git instaweb --httpd=webrick
[2009-02-21 10:02:21] INFO WEBrick 1.3.1
[2009-02-21 10:02:21] INFO ruby 1.8.6 (2008-03-03) [universal-darwin9.0]
--stop
$ git instaweb --httpd=webrick --stop
apt
或 yum
安装一个叫做 gitweb
$ git clone git://git.kernel.org/pub/scm/git/git.git
$ cd git/
$ make GITWEB_PROJECTROOT="/opt/git" \
prefix=/usr gitweb/gitweb.cgi
$ sudo cp -Rf gitweb /var/www/
GITWEB_PROJECTROOT
<VirtualHost *:80>
ServerName gitserver
DocumentRoot /var/www/gitweb
<Directory /var/www/gitweb>
Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
order allow,deny
Allow from all
AddHandler cgi-script cgi
DirectoryIndex gitweb.cgi
</Directory>
</VirtualHost>
http://gitserver
就可以在线访问仓库了,在 http://git.server