ХОРОШО. Это было так просто, как добавление аутентификации. Поскольку я хотел использовать аутентификацию LDAP (на основе Active Directory), я использовал следующее ... Обратите внимание, что ваши пути и пароли могут отличаться ;-)
/etc/gitweb.conf
our $projectroot = "/home/git";
/etc/httpd/conf.vhosts/httpd-vhosts.conf
<VirtualHost *:80> Include conf.vhosts/git.conf </VirtualHost> # if you want HTTPS <VirtualHost *:443> Include conf.vhosts/git.conf SSLEngine on SSLCertificateFile "/var/www/certs/subdomains-cert.pem" SSLCertificateKeyFile "/var/www/certs/subdomains-key.pem" </VirtualHost>
/etc/httpd/conf.vhosts/git.conf
# # Common # ServerAlias git.mol.com.pl DocumentRoot /home/git SetEnv GITWEB_CONFIG /etc/gitweb.conf <Directory /home/git> Order Allow,Deny Allow from all Options +ExecCGI AddHandler cgi-script .cgi DirectoryIndex gitweb.cgi </Directory> SetEnv GIT_PROJECT_ROOT /home/git SetEnv GIT_HTTP_EXPORT_ALL AliasMatch ^/(.*/objects/[0-9a-f]/[0-9a-f])$ /home/git/$1 AliasMatch ^/(.*/objects/pack/pack-[0-9a-f].(pack|idx))$ /home/git/$1 ScriptAliasMatch \ "(?x)^/(.*/(HEAD | \ info/refs | \ objects/info/[^/]+ | \ git-(upload|receive)-pack))$" \ /usr/libexec/git-core/git-http-backend/$1 <Location /> AuthType Basic AuthBasicProvider ldap AuthBasicAuthoritative on AuthUserFile /dev/null AuthLDAPURL ldap://our.domain.server.com/CN=Users,DC=our,DC=domain,DC=server,DC=com?sAMAccountName AuthLDAPBindDN CN=someWindowsDomainUser,CN=Users,DC=our,DC=domain,DC=server,DC=com AuthLDAPBindPassword someWindowsDomainUserSecretPassword Order Allow,Deny Allow from all </Location> # # Test repo # <Location /test-repo.git> AuthName "Test-bare-repo" require valid-user </Location>