1.安装组件gitweb
yum -y install gitweb
2.修改httpd配置文件
vim /etc/httpd/conf/httpd.conf
在末尾添加
##gitweb
<Directory /var/www/git>
Options +ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All
order allow,deny
Allow from all
AddHandler cgi-script .cgi
DirectoryIndex gitweb.cgi
</Directory>
重启httpd
systemctl restart httpd
3.修改gitweb配置文件
a。vim /etc/gitweb.conf
在最末行加上
$projectroot = “/home/haier” ###gerrit中git库文件位置
b。vim /home/gerrit/etc/gerrit.config ####修改gerrit配置文件
在后面添加
【gitweb】
type = gitweb
cgi = /var/www/git/gitweb.cgi
c。重启gerrit
/localdisk/gerrit/bin/gerrit.sh restart