27.3 Gitweb服务器

    前面介绍的HTTP哑协议和智能协议服务架设,都可以用于提供Git版本库的读写服务,而本节介绍的Gitweb作为一个Web应用,只提供版本库的图形化浏览功能,而不能提供版

    空标题文档 - 图1

    27.3.1 Gitweb的安装

    空标题文档 - 图2

    2.使用Git源码安装

    Gitweb的代码位于Git的源码库中,如果Git是从源码进行安装的,那么Gitweb应该已经安装好了。通过下面的命令可以查看Gitweb的安装位置:


    $ls-F$(dirname$(dirname$(git—html-path)))/gitweb gitweb.cgi*static/ $echo$(dirname$(dirname$(git—html-path)))/gitweb /usr/share/gitweb

    Gitweb虽然已经安装,但是尚未和Web服务器整合。在Apache的配置文件中添加如下配置,重启Apache后,即可以用地址/gitweb来访问Gitweb服务。


    Alias/gitweb/usr/share/gitweb <Directory/usr/share/gitweb> Options FollowSymLinks+ExecCGI AddHandler cgi-script.cgi DirectoryIndex index.cgi gitweb.cgi Order Allow,Deny Allow from all </Directory>