# gitweb configuration file for http://git.example.org
our $projectroot = "/mnt/sda1/git-test"; # FHS recommendation
our $site_name = 'Example.org >> Repos';
# git-web app
# need copy gitweb.cgi from /www/cgi-bin/gitweb.cgi
<VirtualHost *:83>
ServerName gitserver
SetEnv GITWEB_CONFIG /etc/gitweb.conf
DocumentRoot /www
<Directory "/www/gitweb">
Options ExecCGI FollowSymLinks SymLinksIfOwnerMatch
Order allow,deny
Allow from all
Require all granted
AddHandler cgi-script cgi
DirectoryIndex gitweb.cgi
</Directory>
</VirtualHost>
# git http read-only server
# 1. /srv/git need apache write permission
# 2. htpasswd -m -c /etc/httpd/conf.d/git-team.htpasswd <username>
<VirtualHost *:84>
SetEnv GIT_PROJECT_ROOT /srv/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/lib/git-core/git-http-backend/
<Location />
AuthType Basic
AuthName "git"
AuthUserFile /mnt/sda1/git-test/git-team.htpasswd
Require valid-user
</Location>
</VirtualHost>