[[email protected] ~]# yum install git [[email protected] ~]# mkdir /data/temp/git [[email protected] ~]# cd /data/temp/git [[email protected] ~]# git init --bare testrepo.git [[email protected] ~]# cd testrepo.git [[email protected] ~]# vi /etc/httpd/conf.d/git.conf **** add this code **** <VirtualHost *:80> ServerName git.rgiapratama.net DocumentRoot /data/temp/git/ <Directory /data/temp/git/> DAV On Options ExecCGI FollowSymLinks Indexes Deny from all AuthType Basic AuthName "GIT" AuthUserFile /etc/httpd/git/htpasswd.git </Directory> <Directory /data/temp/git/testrepo.git> Allow from all Order allow,deny <Limit GET PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> Require valid-user </Limit> </Directory> </VirtualHost> **** end code **** ** Create htpasswd file [[email protected] ~]# htpasswd -c /etc/httpd/git/htpasswd.git username01 [[email protected] ~]# htpasswd /etc/httpd/git/htpasswd.git username02 ** end create htpasswd file [[email protected] ~]# chown apache:apache /data/temp/git -R [[email protected] ~]# sudo -u apache git update-server-info [[email protected] ~]# service httpd restart
Done…
Reference :