直接yum安装。
在/etc/gitweb.conf设置好仓库目录和GIT路径
$projectroot = "/home/git/repositories";
$GIT = "/usr/bin/git"http.conf文件中默认包含git.conf,如没有手动添加。
[git@server ~]$ cat /etc/httpd/conf.d/git.conf
<VirtualHost *:80> ServerName 192.168.*.* DocumentRoot /var/www/git <Directory /var/www/git> Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All order allow,deny Allow from all AddHandler cgi-script cgi DirectoryIndex gitweb.cgi </Directory> </VirtualHost>权限设置非常重要,否则提示找不到项目
[git@server ~]$ chmod 775 /home/git/repositories [git@server ~]$ chmod 775 /home/git