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
~