1.apt-get install gitweb
2.mkdir /home/ceshi/gitweb
3.ln -s /usr/share/gitweb/* /home/ceshi/gitweb
4.将版本库放到/home/ceshi/gitweb目录下:ticket
5.修改/etc/gitweb.conf 中 $projectroot = "/home/ceshi/gitweb";
6.修改apache:
<VirtualHost *:80>
ScriptAlias /gitweb/ /usr/local/apache/cgi-bin/
DirectoryIndex /gitweb/gitweb.cgi
DocumentRoot /home/ceshi/gitweb
ErrorLog "/usr/local/apache/logs/git.pcware.cn-error.log"
CustomLog "/usr/local/apache/logs/git.pcware.cn-access.log" combined
</VirtualHost>
7.重启Apache。 效果类似与:https://git.kernel.org/