1. #安装服务
Apt-get Install Subversion
Apt-get Install LIBAPACHE2-SVN
Apt-get Install Apache2
Apt-get Install Apache2-utils
2. Add SVN Admin user and Subversion Group
$ sudo adduser test
$ sudo addgroup subversion
$ sudo addgroup test subversion
$ sudo addgroup root subversion
2. #创建项目目录
$ sudo mkdir/home/svn
$ sudo cd/home/svn
$ sudo mkdir project
/** Create group if the subversion is not existing**/
$ sudo chown-r root:subversion project
$ sudo chmod-r G+RWS project
3. #创建SVN文件库
Svnadmin Create/home/svn/project
4. #设置访问权限
Modify the/home/svn/project directory:
svnserver.conf file, (no spaces are allowed at the front of the line)
Edit the svnserver.conf file to cancel the comments in the following two lines
Password-db = passwd #用户保存文件的名称
Authz-db = Authz #权限管理文件
passwd and Authz for/home/svn/project/config files passwd and Authz
Description
#[general]
Anon-access=none
Auth-access=write
password-db=passwd
Where anon-access and auth-access are anonymous and privileged user permissions, default to the anonymous user read-only permissions, but if you deny access to anonymous users, only need to change read to none can
5. Create Access users
The last step is to create access users, it is recommended that the user name password file in the current version of the repository under the Conf folder, so the version of the warehouse is not too messy.
Because the passwd file already exists under the Conf folder, it is possible to add users directly:
Htpasswd-c/home/svn/project/conf/passwd Test #test就是用户名
You will be prompted to enter the password two times, the user will create the completed.
The user information is saved in the following file
/home/svn/project/conf/passwd
Test:evnmr/fzedgzy #test: The encrypted password is added later
You can also manually add users to a file, such as:
[Users]
Test = Your_password (Clear text)
6. Permission settings
A) Add user test to Subversion group
[Groups]
Subversion = Test
If more than one user can be separated by commas, the following
Subversion = Test,test2
b) authorizing test users to access the library
[/]
Test = RW
c) authorizing test users to access project
[project:/]
@test = RW
or authorized by group
[/]
@subversion = RW
[project:/]
@subversion = RW
7. Start the SVN service
Svnserve-d-R/HOME/SVN
Description:-D indicates that Svnserver is running in daemon process mode
-r Specifies the root location of the filesystem (the root directory of the repository) so that the client can access the repository without entering the full path
To determine that the service has started:
$ Netstat-ntlp|grep 3690
TCP 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN 2026/svnserve
8. Import Project
CD C:/test/svn/testproject
SVN import-m ' init import ' svn://xxx.xxx.xxx/project/
9. Checkout from another client
CD C:/test2/testproject
SVN checkout svn://xxx.xxx.xxx/project/--username test--password Your_password
Reference documents
http://cnubuntu.com/forum.php?mod=viewthread&tid=8898
Http://www.cnblogs.com/shitouer/archive/2012/07/20/2601231.html
Http://www.cnblogs.com/wuhenke/archive/2011/09/21/2184127.html
Install SVN server in Ubuntu