SVN create repository
Use the svn command to create the repository:
[runoob@centos6 ~]# svnadmin create /opt/svn/runoob01
[runoob@centos6 ~]# ll /opt/svn/runoob01/
total 24
drwxr-xr-x 2 root root 4096 2016/08/23 16:31:06 conf
drwxr-sr-x 6 root root 4096 2016/08/23 16:31:06 db
-r--r--r-- 1 root root 2 2016/08/23 16:31:06 format
drwxr-xr-x 2 root root 4096 2016/08/23 16:31:06 hooks
drwxr-xr-x 2 root root 4096 2016/08/23 16:31:06 locks
-rw-r--r-- 1 root root 229 2016/08/23 16:31:06 README.txt
Enter the /opt/svn/runoob01/conf directory and modify the default configuration files, including svnserve.conf, passwd, and authz, to configure related users and permissions.
1. SVN service configuration file svnserve.conf
The svn service configuration file is conf/svnserve.conf in the repository directory. This file consists of only one [general] configuration section.
[general]
anon-access = none
auth-access = write
password-db = /home/svn/passwd
authz-db = /home/svn/authz
realm = tiku
-
anon-access: Controls the permissions for unauthenticated users to access the repository. The valid values are "write", "read", and "none". That is, "write" means readable and writable, "read" means read-only, and "none" means no access permission. Default value: read.
-
auth-access: Controls the permissions for authenticated users to access the repository. The valid values are "write", "read", and "none". That is, "write" means readable and writable, "read" means read-only, and "none" means no access permission. Default value: write.
-
authz-db: Specifies the permission configuration file name. Through this file, path-based access control can be implemented. Unless an absolute path is specified, the file location is a relative path relative to the conf directory. Default value: authz.
-
realm: Specifies the authentication realm of the repository, that is, the name of the authentication realm prompted at login. If two repositories have the same authentication realm, it is recommended to use the same username and password data file. Default value: a UUID (Universal Unique Identifier, globally unique identifier).
2. Username and password file passwd
The username and password file is specified by the password-db configuration item in svnserve.conf, defaulting to passwd in the conf directory. This file consists of only one [users] configuration section.
The configuration line format of the [users] section is as follows:
<用户名> = <口令>
[users]
admin = admin
thinker = 123456
3. Permission configuration file
The permission configuration file is specified by the authz-db configuration item in svnserve.conf, defaulting to authz in the conf directory. This configuration file consists of one [groups] configuration section and several repository path permission sections.
The configuration line format in the [groups] section is as follows:
<用户组> = <用户列表>
The section name format of the repository path permission section is as follows:
[<版本库名>:<路径>]
[groups]
g_admin = admin,thinker
[admintools:/]
@g_admin = rw
* =
[test:/home/thinker]
thinker = rw
* = r
This example uses svnserve -d -r /opt/svn Start SVN with the multi-repository svnserve method, so the URL:svn://192.168.0.1/runoob01.