Svn Create Repo
# SVN Create Repository
* * *
Use the svn command to create a repository:
[tutorial@centos6 ~]# svnadmin create /opt/svn/tutorial01 [tutorial@centos6 ~]# ll /opt/svn/tutorial01/ 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
Navigate to the `/opt/svn/tutorial01/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` within the repository directory. This file consists of a single `` configuration section.
anon-access = none auth-access = write password-db = /home/svn/passwd authz-db = /home/svn/authz realm = tiku
* **anon-access:** Controls the access permissions for unauthenticated users to the repository. The allowed values are "write", "read", and "none". "write" means read and write access, "read" means read-only access, and "none" means no access permission. Default value: read.
* **auth-access:** Controls the access permissions for authenticated users to the repository. The allowed values are "write", "read", and "none". "write" means read and write access, "read" means read-only access, and "none" means no access permission. Default value: write.
* **authz-db:** Specifies the name of the permissions configuration file. This file enables path-based access control. Unless an absolute path is specified, the file location is relative to the `conf` directory. Default value: authz.
* **realm:** Specifies the authentication realm of the repository, which is the name prompted during login. If two repositories share the same authentication realm, it is recommended to use the same username and password data file. Default value: a UUID (Universally Unique Identifier).
2. Username and Password File `passwd`
The username and password file is specified by the `password-db` configuration item in `svnserve.conf`. By default, it is `passwd` in the `conf` directory. This file consists of a single `` configuration section.
The format for configuration lines in the `` section is:
= admin = admin thinker = 123456
3. Permissions Configuration File
The permissions configuration file is specified by the `authz-db` configuration item in `svnserve.conf`. By default, it is `authz` in the `conf` directory. This configuration file consists of a `` section and several repository path permission sections.
The format for configuration lines in the `` section is:
=
The format for repository path permission section names is:
[:] g_admin = admin,thinker [admintools:/]@g_admin = rw * =[test:/home/thinker] thinker = rw * = r
This example uses **svnserve -d -r /opt/svn** to start SVN in multi-repository svnserve mode, so the URL is: **svn://192.168.0.1/tutorial01**.
YouTip