Ubuntu12.04配置Svn+Apache的版本控制服务器

转自http://www.cnblogs.com/standsun/archive/2012/08/10/2631334.html


" 安装apache2
sudo apt-get install apache2

" 安装apache的svn扩展模块
sudo apt-get install libapache2-svn

" 安装subversion
sudo apt-get install subversion

" 创建版本库保存的文件家
sudo mkdir /home/subversion

" 创建项目的版本库
sudo svnadmin create /home/subversion/project

" /etc/apache2/http.conf 末尾添加project的配置
<Location /project>
    DAV svn
    SVNPath /home/subversion/project
    AuthType Basic
    AuthName "project description"
    AuthUserFile /home/subversion/project/conf/passwd
    <LimitExcept GET PROPFIND OPTIONS REPORT>   " 如果想每次登陆都输入密码请把这个标签对引掉
    Require valid-user
    </LimitExcept>
</Location>

" 重启apache
sudo service apache2 restart

" 添加版本库的访问帐号
sudo htpasswd -c /home/subversion/project/conf/passwd admi
复制代码

附上Apache默认的Svn配置示例

复制代码
" dav_svn.conf - Example Subversion/Apache configuration
"
" For details and further options see the Apache user manual and
" the Subversion book.
"
" NOTE: for a setup with multiple vhosts, you will want to do this
" configuration in /etc/apache2/sites-available/*, not here.

" <Location URL> ... </Location>
" URL controls how the repository appears to the outside world.
" In this example clients access the repository as http://hostname/svn/
" Note, a literal /svn should NOT exist in your document root.
<Location /svn>

    " Uncomment this to enable the repository
    DAV svn

    " Set this to the path to your repository
    "SVNPath /var/lib/svn
    " Alternatively, use SVNParentPath if you have multiple repositories under
    " under a single directory (/var/lib/svn/repo1, /var/lib/svn/repo2, ...).
    " You need either SVNPath and SVNParentPath, but not both.
    SVNParentPath /var/lib/svn

    " Access control is done at 3 levels: (1) Apache authentication, via
    " any of several methods.  A 'Basic Auth' section is commented out
    " below.  (2) Apache <Limit> and <LimitExcept>, also commented out
    " below.  (3) mod_authz_svn is a svn-specific authorization module
    " which offers fine-grained read/write access control for paths
    " within a repository.  (The first two layers are coarse-grained; you
    " can only enable/disable access to an entire repository.)  Note that
    " mod_authz_svn is noticeably slower than the other two layers, so if
    " you don't need the fine-grained control, don't configure it.

    " Basic Authentication is repository-wide.  It is not secure unless
    " you are using https.  See the 'htpasswd' command to create and
    " manage the password file - and the documentation for the
    " 'auth_basic' and 'authn_file' modules, which you will need for this
    " (enable them with 'a2enmod').
    AuthType Basic
    AuthName 'Subversion Repository'
    AuthUserFile /etc/apache2/dav_svn.passwd

    " To enable authorization via mod_authz_svn
    AuthzSVNAccessFile /etc/apache2/dav_svn.authz

    " The following three lines allow anonymous read, but make
    " committers authenticate themselves.  It requires the 'authz_user'
    " module (enable it with 'a2enmod').
    "<LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
    "</LimitExcept>

</Location>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值