???????Linux????????Linux????Apache??????Git?????????????????
???????????????????????
????Linux?汾??CentOS 6.5
????Apache?汾??Apache/2.2.15
????Git?汾??git 1.7.1
????Git????????????http????????????SSL??
????Apache????
????1. ???Apache?????yum install httpd
????2. ????Apache??????????????У?chkconfig --levels 235 httpd on
????Git??????????
????1. ???git
????yum install git
????2. ??? git-core????????git-http-backend——???git??CGI????apache???git??????
????yum install git-core
????3. ???????git repository??????У???????????/home/git
????cd /home && mkdir git && cd git
????4. ?????????????
????mkdir git-test && cd git-test
????5. ???????????????????git-test????????????????飬???apache???/д????????
????chown -R apache:apache .
????Apache??????
????1. ????????git?????????????????????apache?????
????1.1 ?????????
????htpasswd -m -c /etc/httpd/conf.d/git-team.htpasswd <username>
????????????????????????
????1.2 ???git-team.htpasswd????????????????????
????chown apache:apache /etc/httpd/conf.d/git-team.htpasswd
????1.3 ????git-team.htpasswd???????????
????chmod 640 /etc/httpd/conf.d/git-team.htpasswd
????Linux ???????chmod http://www.linuxidc.com/Linux/2016-12/138322.htm
????Linux????chmod????? http://www.linuxidc.com/Linux/2016-11/136810.htm
????Linux????????chmod?????????/????????? http://www.linuxidc.com/Linux/2016-09/135405.htm
????2. ???apache???????httpd.conf
????2.1 ??vim??httpd.conf??vi /etc/httpd/conf/httpd.conf
????2.2 ??????????????β??0G
????2.3 ??????μ??????
<VirtualHost *:80>
ServerName git.cnblogs.com
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv GIT_PROJECT_ROOT /home/git
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
<Location />
AuthType Basic
AuthName "Git"
AuthUserFile /etc/httpd/conf.d/git-team.htpasswd
Require valid-user
</Location>
</VirtualHost>
????ServerName??git????????????
????/home/git??????????????
????ScriptAlias?????/git/????????·???????git??CGI????git-http-backend
????AuthUserFile????????????????
????2.4 ???沢???:x
????3. ????apache???????Ч
????service httpd restart
????????????Git??????
???????????????????git-test?????
????git clone http://git.cnblogs.com/git/git-test
??????????????????????????????????????????????
????remote: Counting objects: 6?? done.
????remote: Compressing objects: (4/4)?? done.
????remote: Total 6 (delta 0)?? reused 0 (delta 0)
????Unpacking objects: (6/6)?? done.