git + https(apache2)比较方便地添加新版本库

因apache2中添加一个git库需要修改conf文件,比较麻烦。

所以在 /etc/apache2/mods-available/dav_git.conf 中可以这样写:

Alias /git "/repository_git/"

<Directory "/repository_git/">
        DAV On
        SSLRequireSSL
        Options +Indexes +FollowSymLinks

        Deny from all

        AuthType Basic
        AuthName "Git Repository"
        AuthUserFile "/authz/svn_git_passwd"
        AuthGroupFile "/authz/git_group"
</Directory>

Include /authz/git_config.d/*.conf

 

然后在 /authz/git_config.d/ 目录可以为每个项目单独放一个conf文件来配置每个仓库。
cat svn_authz/git_config.d/testproject.conf

<directory "/repository_git/testproject.git/">
        Allow from all
        Order Allow,Deny

        #read only grourp
        <Limit GET>
                Require group guest
        </Limit>
        #commit group
        <Limit GET PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
                Require group testproject_admin
        </Limit>
</Directory>

注: 以上配置文件中的目录仅供参考,请根据实际情况合理安排目录。

posted on 2012-12-29 00:54  aozima  阅读(1275)  评论(0编辑  收藏  举报

导航