1. Install the SVN

[root@localhost ~]# yum install subversionCopy the code

2. Enter RPM -QL Subversion to check the installation position, as shown below:

[root@localhost ~]# rpm -ql subversion
/etc/subversion
/etc/sysconfig/svnserve
/run/svnserve
/usr/bin/svn
/usr/bin/svnadmin
/usr/bin/svndumpfilter
/usr/bin/svnlook
/usr/bin/svnrdump
Copy the code

You can see that the SVN generates several binaries in the bin directory.

Enter /usr/bin/SVNversion –version to view the SVN version. In this case, the SVN is successfully installed

[root@localhost ~]# /usr/bin/svnversion --versionCopyright (C) 2013 Apache Software Foundation. All rights reserved. This software contains contributions from many people, see the file NOTICE for more information. Subversion is open source software, please refer to the http://subversion.apache.org/ site.Copy the code

3. Create the SVN version library directory

[root@localhost ~]# mkdir -p /var/svn/svnreposCopy the code

4. Create a version library

[root@localhost ~]# svnadmin create /var/svn/svnreposCopy the code

After the command is executed, the following files are generated in the /var/svn/SVNrepos /conf directory

[root@localhost conf]# lsauthz passwd svnserve.conf
Copy the code

5. Go to the conf directory (the SVN version library configuration file)

The Authz file is a permission control file

Passwd is the account password file

Svnserve. conf SVN service configuration file

6. Set the account password

vim passwd

— — — — — — — — — — — — — — — — — — — — — — — the following is the passwd file — — — — — — — — — — — — — — — — — — — — — — — — — — — — — [users] # username = password harry = harryssecret

Add a user and password to the [Users] block in the format of account = password, for example, Dan = Dan

7. Set permissions

vi authz

Add the following code at the end:

[/]Harry = RWW =rCopy the code


8. Modify the SVNserve. conf file

vi svnserve.conf

Open the following comments:

Anon-access = read # anonymous user readable

Auth-access = write # Authorizes users to write

Password-db = passwd # which file to use as the account file

Authz-db = authz # Which file to use as the permission file

Realm = /var/svn/SVNRepos

9. Start the SVN version library

svnserve -d -r /var/svn/svnrepos