gitweb

 
    gitweb就是支持网页查看git版本库中代码的工具。

搭建Apache

Apache Http 服务器搭建

搭建gitweb

 
# yum install gitweb

 
在默认的文件末尾添加:

  1. $projectroot = '/home/git/gitweb'; #gitweb展示的那些代码库的根目录

(2) 配置 /etc/httpd/conf.d/git.conf,如下:

1
2
3
4
5
6
7
8
9
10
Alias /gitweb /var/www/git
SetEnv GITWEB_CONFIG /etc/gitweb.conf
<Directory /var/www/git>
Options ExecCGI FollowSymLinks SymLinksIfOwnerMatch
AllowOverride All
order allow,deny
Allow from all
AddHandler cgi-script cgi
DirectoryIndex gitweb.cgi
</Directory>

 

 转到的目录)的一些性质。

(3) 添加代码库到gitweb指定的代码库根目录下:

1
2
3
4
假设已经存在了一个版本库 /home/git/repos/DataExchange.git,可以拷贝或者软链接:
cp -r /home/git/repos/DataExchange.git /home/git/gitweb/DataExchange
ln -s /home/git/repos/DataExchange.git /home/git/gitweb/DataExchange

 (4) 确保 apache用户(在httpd.conf中配置的用户)具有访问 gitweb指定代码库的权限

比如, /home/git/gitweb 属于git用户和git组。可以将apache用户添加到 git组中:

usermod -a -G git apache

相关文章:

  • 2021-06-15
  • 2021-11-23
  • 2021-07-30
  • 2021-11-15
  • 2021-05-10
  • 2021-12-04
  • 2021-12-09
  • 2021-11-30
猜你喜欢
  • 2022-01-02
  • 2021-09-15
  • 2022-12-23
  • 2021-09-29
  • 2022-02-22
  • 2022-12-23
  • 2021-10-26
相关资源
相似解决方案