qq:971751392 (Welcome Exchange)
1 Installing SVN
Official website Download: http://subversion.apache.org/packages.html
SVN client: TortoiseSVN, official website download: http://tortoisesvn.net/downloads.html
# Yum Install Subversion:
1. Create a new directory to store all SVN files
- # MKDIR/SVN
2. Create a new resource warehouse
- # svnadmin Create/svn/project
- # ls/svn/project/
- Conf db format Hooks Locks README.txt
Directory Use Description:
L Hooks directory: directory where hook script files are placed
L Locks Directory: The directory used to place Subversion db lock files and Db_logs lock files to track the clients accessing the vault
L Format File: is a text file with only an integer in it, indicating the version number of the current vault configuration
L conf Directory: is the configuration file of this warehouse (user access account, permissions, etc.) of the warehouse
3. Configure the SVN service configuration file svnserver.conf file
- # vi/svn/project/conf/svnserve.conf
- [General]
- Anon-access = None
- auth-access = Write
- Password-db =/svn/project/conf/passwd
- Authz-db =/svn/project/conf/authz
- Realm = My Test Repository #这是个提示信息
Save
4. Add two access users and passwords
- # VI/SVN/PROJECT/CONF/PASSWD
- [Users]
- Xiaoran.shen = 123456
- Test1 = 123456
- Test2 = 123456
Save
Note : Changes to the user profile take effect immediately without restarting the SVN service.
5. Configure the authorization file for the new user
- # Vi/svn/project/conf/authz
- [Groups]
- admin = Xiaoran.shen,test1
- user = Test2
- [/]
- @admin = rw
- @user = R
- * =
Save
Format Description:
Repository directory format:
[< Repository >:/project/catalog]
@< user Group Name > = < permissions >
< user name > = < permissions >
/indicates that permissions are set on all subdirectory scopes under the root directory (that is, the/svn/project directory);
[/ABC] means setting permissions on the ABC project in the repository;
Create an admin group with group members including Xiaoran.shen and Test1
Create a user group with only TEST2 members;
The admin group has read and write access to the directory;
Single user test2 have read and write permission;
*= indicates that in addition to the permissions set above the user group, all other users set the empty permissions, the null permission to prohibit access to this directory, it is important to add.
Note: Changes to the permissions profile take effect immediately and do not have to restart SVN.
6. Start the SVN service
Svnserve-d-r/svn/project/
Note: do not use the system-provided/etc/init.d/svnserve start to start, because the system default startup script does not use the –r/svn/project parameter to specify a resource. In this case, the SVN service is started, and the client connection will prompt "Svn:no repository found in ' Svn://192.168.11.229/project '" error.
The default SVN server port is 3690.
Kill SVN Service:
- # Ps-ef|grep SVN
- Root 4642 1 0 16:08? 00:00:00 svnserve-d-r/svn/project/
- Root 4692 3676 0 16:13 pts/2 00:00:00 grep svn
- # kill-9 4642
To use the/etc/init.d/svnserve script, you can modify the start () function section as follows:
- Start () {
- [-X $exec] | | Exit 5
- [-f $config] | | Exit 6
- Echo-n $ "Starting $prog:"
- Daemon --pidfile=${pidfile} $exec $args-R/svn/project
- Retval=$?
- Echo
- [$retval-eq 0] && Touch $lockfile
- Return $retval
- }
Complete
2 Using Client connections
2.1 Clients that use Windows
Open the TortoiseSVN Repository Browser tool
In the URL, enter:
svn://192.168.11.229 Enter, prompt for user name and password
2.2 Using the command line under Linux
- # SVN Co svn://192.168.11.229
3 FAQs
3.1 Command line connection, prompt Svn:no repository found in ' Svn://192.168.11.229/project ' error?
WORKAROUND: The-r/svn/project parameter is not used when starting the SVN service and does not indicate the specific path of the repository. Use the # svnserve-d-r/svn/project/command to start it, and do not use the/etc/init.d/svnserver script.
3.2 "Svn:authorization failed" error when executing command # SVN co svn://192.168.11.229/project?
Workaround: The general reason for this authorization failure is from the configuration of the Conf/authz file
The correct configuration is as follows:
- [Groups]
- admin = Xiaoran.shen,test1
- user = Test2
- [/]
- @admin = rw
- @user = rw
- * =
Save
MyEclipse
Linux Build SVN server--fee yuan Daniel