Install and configure SVN server on the linux

Set up SVN server

1. Download svn installation package

[root@localhost veris]#yum install subversion

[root@localhost veris]# svnserve --version
svnserve, version 1.6.11 (r934486)
compiled Mar  6 2014, 10:33:29

2. To create a repository:

  1. Create a directory for the repository by running the following command:

    mkdir -p REPOS_PATH
    

    In this command, REPOS_PATH is the absolute path to the local file system.

    For example:

    mkdir –p /svn/svnrepo
  2. Create a repository on a given path by running the following command:

    svnadmin create REPOS_PATH

    In this command REPOS_PATH is the absolute path to the local file system.

    For example:

    svnadmin create /svn/svnrepo
3. Start/STOP SVN server:

Start:

$/etc/init.d/svnserve start

Starting svnserve:                                         [  OK  ]

Check:

$ ps -aux | grep svnserve 

root      2303  0.0  0.1   8740   824 ?        Ss   19:49   0:00 /usr/bin/svnserve --daemon --pid-file=/var/run/svnserve.pid
root      2306  0.0  0.1   4356   740 pts/0    S+   19:49   0:00 grep svnserve

Stop:

$/etc/init.d/svnserve stop

Stopping svnserve:                                         [  OK  ]

OR

Start: $svnserve -d -r /svn/svnrepo (About /svn/svnrepo problem, sometime you can use the path without repository name.like/svn ,sometimes, you should input with repository name, like /svn/svnrepo )

Check: $ps -aux | grep svnserve   

root      2865  0.0  0.1   8740   660 ?        Ss   21:56   0:00 svnserve -d -r /svn/svnrepo
root      2867  0.0  0.1   4356   744 pts/0    S+   21:56   0:00 grep svnserve

Stop: $kill -9 2865

4. Until now, the SVN server has been installed, you can verify it on the local computer. I use TortoiseSVN as svn client.

1. Create a folder under your work folder, for example, E:/work/svnrepo(the folder name can be different with the repository)

2.  Move the mouse pointer above this folder, and right-click , press "SVN Checkout"  -- "SVN Checkout" can download the repository  for server.

3. Input the svn://192.168.0.33/svn/svnrepo and Press OK . (you can use your ip to replace this ip).

Note: If you can access the svn server, please check your server firewall and close it.

$/etc/init.d/iptables stop

Until now, you have connected your SVN successfully, but you can't add file or folder because you haven't configure your SVN server. You should add user into SVN sever and grant these user different privilege to modify files.


Configure the SVN Server

Authentication Configuration:

1. Add user

$vim /svn/svnrepo/conf/passwd

and insert "username = passwd" ,like:

admin = 123456 #Admin user who can read and write all directory and files

prodadm = 123456 # Product admin user who can read and write all directory and files under products files

docsadm = 123456 #Document admin user who can read and write all directory and files under documents files.

2. Edit the privilege management file:

$vim /svn/svnrepo/conf/authz ,edit it,like:

[groups]   ## Create the user_group

prodadm_group = admin,prodadm  ##Notes:you should add admin into this group
docadm_group = admin,docadm

[/]      ## Repository admin have privilege under "/" .Notes: Here, I just grant a user

admin = rw

* = r

[/Documents]   ##  Documents admin have privilege under the current path. Notes: Here, I grant a group "@groupname"
@docadm_group = rw
* = r

[/Products]  ##  Products admin have privilege under the current path. Notes: Here, I grant a group "@groupname"
@prodadm_group = rw
* =                ## Notes. other people can't access this directory.

Active Authentication Configuration:

Edit svnserve.conf 

$vim  /svn/svnrepo/conf/svnserve.conf

[general]
anon-access = none
auth-access = write
password-db = /svn/svnrepo/conf/passwd
authz-db = /svn/svnrepo/conf/authz


PS:

After you change the configuration files, the configuration file are available instantly.It is not necessary to restart your svn server.


When we uncomment parameters in svnserve.conf during svn server configuration , it leaves a whitespace character before the parameter. Just remove the whitespace character from the parameters you uncommented in svnserve.conf

anon-access = read
auth-access = write

This should resolve the issue.

SVN是基于关系数据库的(BerkleyDB)或一系列二进制文件的(FS_FS)。一方面这解决了许多问题 (例如,并行读写共享文件)以及添加了许多新功能(例如运行时的事务特性。)。然而另一方面,数据存储由此变得不透明。

基于以上所以你在服务上是找不到你提交的原始文件,因为svn每次提交做的都是原子提交,所以你在服务器上能找到的都是一些碎片文件.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值