How To: subversion SVN with Apache2 and DAV

You can get a pdf    edition of this article from here
<script type="text/javascript"> var MarginLeft = -50; //浮动层离浏览器右侧的距离 var MarginTop = 120; //浮动层离浏览器顶部的距离 var Width = 118; //浮动层宽度 var Heigth= 66; //浮动层高度 //设置浮动层宽、高 function Set() { document.getElementById("FloatDIV").style.width = Width + 'px'; document.getElementById("FloatDIV").style.height = Heigth + 'px'; } //实时设置浮动层的位置 function Move() { var b_top = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; var b_width= document.body.clientWidth; document.getElementById("FloatDIV").style.top = b_top + MarginTop + 'px'; document.getElementById("FloatDIV").style.left = b_width - Width - MarginLeft + 'px'; setTimeout("Move();",10); } Set(); Move(); </script>

Subversion is an application used for version control, it is meant to become a replacement of CVS Concurrent Versions System. Subversion is also known as svn.

This how-to will show how to setup svn repositories accessible throught http by using apache2 and the DAV module.

This tutorial is splitted in 4 parts: install neccessary packages, create the repository structure, configure apache and create the first repository.

Neccessary packages:

First of all we need to install the required packages:

apt-get install subversion libapache2-svn

Repository structure:

The projects are going to be hosted on /var/svn/repository. We need to create to directories and give full permission to the apache user:

mkdir /var/svn
  mkdir /var/svn/repository

Now that the directory exist, we need to give write access to the apache user:

chown www-data:www-data -R /var/svn/repository
  chmod 770 -R /var/svn/repository

Configuring Apache:

Now, we need to modify apache svn module configuration file, edit /etc/apache2/mods-available/dav_svn.conf and make sure the following argument are properly setted up:

...
SVNParentPath /var/svn/repository
#SVNPath /var/svn/repository
.....
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user
...

In order to be able to track who modify the different files of the project, we need to create users. Create the first user (tester) and supply a password:

htpasswd -c /etc/apache2/dav_svn.passwd tester

Creating a first repository:
Get apache user access (so files and directories are created with proper rights:

su www-data

and create your first repository (example):

svnadmin create /var/svn/repository/example

import your project:

svn import /path/to/projectexample file:///var/svn/repository/example/examplev1 -m"initial import"

Now, get back to root user (Ctrl-D) and restart apache:

/etc/init.d/apache2 restart

Your project is now avalaible to the different user you will add in /etc/apache2/dav_svn.passwd .
User tester can now access the project at http://svnhostaddress/example and checkout a first copy to his computer, modify files and commit back his changes to the server



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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值