RHEL7.2/Centos git web 1. instaweb 2. gitweb with Apache

54 篇文章 0 订阅
20 篇文章 0 订阅

1. Build with source 

Default, git/v1.8.3.1 on RHEL/Centos7 does not have git instaweb program.

 git clone -b   v1.8.3.1   --depth 1    https://github.com/git/git.git

make 

make install (Default into $HOME)

git instaweb --httpd=webrick   ----> Ruby web server (TCP port 1234)

 

 

2. Build gitweb from git source and integrated with Apache web server

[root@localhost gitweb]# ls -l ~lake/git_repository/git-v1.8.33/gitweb/
total 524
-rw-r--r-- 1 lake sys    859 Mar 19 22:10 GITWEB-BUILD-OPTIONS
-rwxr-xr-x 1 lake sys 248423 Mar 19 22:10 gitweb.cgi
-rwxr-xr-x 1 lake sys 248656 Mar 19 02:58 gitweb.perl
-rw-r--r-- 1 lake sys  14728 Mar 19 02:58 INSTALL
-rw-r--r-- 1 lake sys   5641 Mar 19 02:58 Makefile
-rw-r--r-- 1 lake sys   2392 Mar 19 02:58 README
drwxr-xr-x 3 lake sys   4096 Mar 19 02:59 static

[root@localhost gitweb]#  cp * /var/www/gitweb 

 

 

[lake@LongchangHost git]$ pwd
/var/www/git
[lake@LongchangHost git]$ ls -l
total 256
-rwxr-xr-x 1 lake sys  248466 Aug 23  2017 gitweb.cgi 
drwxr-xr-x 2 lake sys    4096 Mar 20 10:26 static
lrwxrwxrwx 1 root root     30 Mar 20 10:32 test -> /home/lake/git_repository/test
[lake@LongchangHost git]$ vim       gitweb.cgi 
   

  74 # this can just be "git" if your webserver has a sensible PATH
  75 our $GIT = "/home/lake/usr/bin/git";
  76 
  77 # absolute fs-path which will be prepended to the project path
  78 #our $projectroot = "/pub/scm";

  79 our $projectroot = "/var/www/gitweb";

 

Add /etc/httpd/conf/httpd.conf  

 

or

rpm install/gitweb will have a conf in /etc/httpd/conf.d/git.conf

 
Alias /gitweb "/var/www/gitweb"

<Directory "/var/www/gitweb">
    DirectoryIndex gitweb.cgi
    Options ExecCGI
    Require all granted
    <Files gitweb.cgi>
    SetHandler cgi-script
    </Files>
#    SetEnv  GITWEB_CONFIG  /etc/gitweb.conf   <<<<<<<  This can be set in gitweb.cgi/perl script....  
</Directory>

 

 

 

4. RPM install Note:  Centos7 

[lake@localhost ]$ rpm -ql    gitweb-1.8.3.1-12.el7_4.noarch

/etc/gitweb.conf
/etc/httpd/conf.d/git.conf
/usr/share/doc/gitweb-1.8.3.1
/usr/share/doc/gitweb-1.8.3.1/INSTALL
/usr/share/doc/gitweb-1.8.3.1/README
/var/www/git
/var/www/git/gitweb.cgi
/var/www/git/static
/var/www/git/static/git-favicon.png
/var/www/git/static/git-logo.png
/var/www/git/static/gitweb.css
/var/www/git/static/gitweb.js

 

                                                                                                     

 

~        

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值