svn server has two operating modes: stand-alone server svnserve and apache as a means of apache module to webdav / deltav protocol communications. svn version of the data is stored in two ways: BDB and FSFS. BDB way when the server is interrupted, may lock the data. FSFS way safer, better compatibility.
One. Install subversion
# wget http://subversion.tigris.org/downloads/subversion-1.6.13.tar.gz
# wget http://subversion.tigris.org/downloads/subversion-deps-1.6.13.tar.gz
# tar -xzvf subversion-1.6.13.tar.gz -C ../software/
# tar -xzvf subversion-deps-1.6.13.tar.gz -C ../software/
# cd ../software/subversion-1.6.13/
# ./configure --prefix=/usr/local/subversion-1.6.13
# make clean
# make
# make install
# ./svnserve --version
svnserve, version 1.6.13 (r1002816)
compiled Jun 1 2011, 10:19:12
Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository back-end (FS) modules are available:
* fs_fs : Module for working with a plain file (FSFS) repository.
Cyrus SASL authentication is available.
The output of the above information the installation was successful.
two. The establishment of library files
1. Create a folder
# mkdir -p /www/svn/repository
2. Create the repository and specify data storage mode is FSFS
# ./svnadmin create --fs-type fsfs /www/svn/repository/
# ls /www/svn/repository/
conf db format hooks locks README.txt
3. Create a temporary directory project
# mkdir -p /www/svn/tmp/{trunk,tags,branches}
4. Copy the file to the trunk directory project
# cp -r nginx /www/svn/tmp/trunk/
5. Import required for the project management of the repository to repository
# ./svn import /www/svn/tmp/ file:///www/svn/repository/ -m "first import"
-m 标识操作的注释
/ww/svn/tmp/trunk/nginx 项目文件的位置
file:///www/svn/repository 创建的软件仓库
Adding /www/svn/tmp/trunk/nginx/client_body_temp
Adding /www/svn/tmp/trunk/nginx/uwsgi_temp
Adding /www/svn/tmp/trunk/nginx/logs
Adding /www/svn/tmp/trunk/nginx/logs/access.log
Adding /www/svn/tmp/trunk/nginx/logs/error.log
Adding /www/svn/tmp/trunk/nginx/html
Adding /www/svn/tmp/trunk/nginx/html/50x.html
Adding /www/svn/tmp/trunk/nginx/html/index.html
Adding /www/svn/tmp/trunk/nginx/fastcgi_temp
Adding /www/svn/tmp/trunk/nginx/conf
Adding /www/svn/tmp/trunk/nginx/conf/uwsgi_params
Adding /www/svn/tmp/trunk/nginx/conf/fastcgi_params
Adding /www/svn/tmp/trunk/nginx/conf/uwsgi_params.default
Adding /www/svn/tmp/trunk/nginx/conf/fastcgi.conf
Adding /www/svn/tmp/trunk/nginx/conf/fastcgi_params.default
Adding /www/svn/tmp/trunk/nginx/conf/fastcgi.conf.default
Adding /www/svn/tmp/trunk/nginx/conf/nginx.conf
Adding /www/svn/tmp/trunk/nginx/conf/scgi_params
Adding /www/svn/tmp/trunk/nginx/conf/win-utf
Adding /www/svn/tmp/trunk/nginx/conf/nginx.conf.default
Adding /www/svn/tmp/trunk/nginx/conf/mime.types
Adding /www/svn/tmp/trunk/nginx/conf/scgi_params.default
Adding /www/svn/tmp/trunk/nginx/conf/mime.types.default
Adding /www/svn/tmp/trunk/nginx/conf/koi-win
Adding /www/svn/tmp/trunk/nginx/conf/koi-utf
Adding /www/svn/tmp/trunk/nginx/proxy_temp
Adding /www/svn/tmp/trunk/nginx/scgi_temp
Adding /www/svn/tmp/trunk/nginx/sbin
Adding (bin) /www/svn/tmp/trunk/nginx/sbin/nginx
Committed revision 1.
6. Check whether the import was successful
# ./svn list --verbose file:///www/svn/repository/
1 root Jun 01 10:48 ./
1 root Jun 01 10:48 client_body_temp/
1 root Jun 01 10:48 conf/
1 root Jun 01 10:48 fastcgi_temp/
1 root Jun 01 10:48 html/
1 root Jun 01 10:48 logs/
1 root Jun 01 10:48 proxy_temp/
1 root Jun 01 10:48 sbin/
1 root Jun 01 10:48 scgi_temp/
1 root Jun 01 10:48 uwsgi_temp/
7. Modify the repository file permissions
# chmod 770 repository
# chmod -R g+w repository
three. User Management
1. Modify the repository configuration file
# vim /www/svn/repository/conf/svnserve.conf
[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
realm = repository
[sasl]
2. Modify allow users to access the repository file
# vim /www/svn/repository/conf/passwd
File format is as follows:
[users] //不可省略
username1=password1
username2=password2 //每个用户一行
New User List
xuhh = [email protected]
3. Modify the user access to the repository
# vim /www/svn/repository/conf/authz
Note: Username rights profile appearance must have been defined in the passwd file, permissions profile authz changes will take effect immediately. File format is as follows: User group format:
[groups]
user_group_name=username1,username2 //用户间以逗号分割
Repository directory format:
[repository:/project/directory] //版本库:/项目/目录
@user_group_name=permissions //用户组名=权限
username=permissions //用户名=权限
[] Can have multiple definitions / presentation of all of the repository set permissions, repos1: / told repos1 set permissions, repos2: / www www expressed in the project set permissions repos2, repos2: /www/example.com told example.com directory set permissions repos2 the www project. * Can be used to represent all users. Permissions can be set to w, r, wr and empty, empty means no rights. New user permission to access the repository
[aliases]
[groups]
developer = xuhh
[/]
@developer = rw
four. Starting and stopping subversion 1. Start svn
# ./svnserve -d --listen-port 9999 -r /www/svn/repository --log-file /usr/local/subversion-1.6.13/logs/svn.log --pid-file /usr/local/subversion-1.6.13/logs/svn.pid
-d run in daemon mode --listen-port listening port number specified directory -r --log-file Specifies the log file --pid-file specified pid file 2. Stop svn
# kill -9 `cat /usr/local/subversion-1.6.13/logs/svn.pid`
Fives. Installation TortoiseSVN 2.Linux at the next client access 1.Windows
# svn checkout svn://192.168.50.10:9999
Please indicate the source: http: //www.ttlsa.com/html/711.html
Reproduced in: https: //my.oschina.net/766/blog/211394