Install git from the yum repository
If you have error regarding GPG KEYS then please check my answer on StackOverflow.com
Install git from the yum repository
1 |
yum install git git-daemon |
Configure Git and Init bare repository
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ cd /var/www/ $ mkdir git $ cd git $ mkdir repos.git $ cd repos.git $ git init --bare $ chown -R apache:apache /var/www/git/ $ mv /var/www/git/repos.git/hooks/post-update.sample /var/www/git/repos.git/hooks/post-update $ chmod +x /var/www/git/repos.git/hooks/post-update $ cd /var/www/git/repos.git $ sudo -u apache git update-server-info $ cd /etc/httpd/conf.d $ vim git.conf |
Apache Virtual Host directive
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<virtualhost *:80> Servername git.example.org DocumentRoot /var/www/git <directory "/var/www/git"> DAV On Options +Indexes +FollowSymLinks Deny from all AuthType Basic AuthName "Git Repository" AuthUserFile /etc/git-auth-conf AuthGroupFile /etc/git-group-conf Require valid-user </directory> </virtualhost> |
Restart Apache
1 |
$ service httpd restart |