1.svn server 端的安装的前提是必须要安装 apache http软件的,为什么呢? because SUBVERSION 是 apache下的项目,apache为他提供了整合http,https等协议。

信息来源:

In November 2009, Subversion was accepted into Apache Incubator, which is the first step for open source projects to become a fully-fledged Apache Software Foundation project. In February 2010, it became just that, an Apache Software Foundation project.

 

2.svn的所存在的问题

like anything, it has its downsides, one of which is its speed. If you’re working with a remote repository and you need to commit your files and you happen to be using a slow Internet connection, you are be waiting a long time.

 

 

 

安装与基本应用


1.svn安装(分成两种):

apt-get install :

Sudo apt-get update
Sudo apt-get install subversion libapache2-svn

 

source code version

 

2. 创建仓库与仓库的文件权限

Sudo mkdir /var/svn-repos/

 

Sudo groupadd subversion

Sudo chown -R www-data:subversion /var/svn-repos/*            【仓库的用户属于apache用户(www-data),而组依然为svn: 保证了http可以整合svn,同时安全】
Sudo chmod -R 770 /var/svn-repos/*                                     【所属组必须有写入权限】

 

3. 创建工程与规划

Sudo svnadmin create --fs-type fsfs /var/svn-repos/project_test

Sudo svn mkdir -m "initial setup" file:///var/svn-repos/project_test/trunk
Sudo svn mkdir -m "initial setup" file:///var/svn-repos/project_test/branches
Sudo svn mkdir -m "initial setup" file:///var/svn-repos/project_test/tags

 

TIPS:You’ll also be adding the trunk, branches, and tags directories into the repositories here to ensure the repository is in the correct format(FSFS的格式,默认是DB的格式).

 

 

4. start svn server

svnserve -d –r  /var/svn-repos/

 

-d : 指定要开启的目录

-r  : 在后台运行

 

5. 关闭svn服务

SVN的进程名: svnserve 

查找svn相关的PID值: ps aux |grep svnserve

kill –9  PID值

或者

killAll  -9 svnserve

 

 

 

 

 

配置相关


1. 分配用户名以及密码.

1.在conf目录下打开svnserve.conf 文件,将匿名用户访问关闭【删除注释之后,一定不要留下空格】 anon-access = none

[general]
### These options control access to the repository for unauthenticated
### and authenticated users.  Valid values are "write", "read",
### and "none".  The sample settings below are the defaults.
#anon-access = read
#anon-access = write
#auth-access = write
#auth-access = none
anon-access = none【关键】

相关文章: