Installation
Yum-y Install httpd git
Create a warehouse
Mkdir/test && CD/--
Vi/test/test.git/config
True
Modify Http.conf
Vi/etc/httpd/conf/httpd.conf
# Set up a directory of projects managed by GIT Setenv Git_project_root/testsetenv Git_http_export_allscriptalias/test//usr/libexec/git-core/git-http-backend/# Various requests for GIT libraries, execute git-http-Backend.cgiscriptaliasmatch"(? x) ^/(. */(HEAD | \Info/refs |Objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{ -} |Pack/pack-[0-9a-f]{ +}\. (PACK|IDX)) |git-(upload|receive)-pack)) $" \/usr/libexec/git-core/git-http-backend/$1Scriptalias//usr/share/gitweb/gitweb.cgi# Add authentication for git HTTP operation, the authentication information exists git-In the auth file, the matching # for this file will be explained later<location/>authtype Basicauthname"Git Access"AuthUserFile/var/www/git-Authrequire Valid-Userauthbasicprovider File</Location>
Create a connection
ln-s/test/var/www/test
Generate password
Htpasswd-c Git-auth User
Start
Systemctl Restart httpd
Test
git clone http://user:[email protected]/test/test.git
CentOS Build git http Server