Add a Linux SVN server to favorites. simple memo yuminstallsubversion # install svngroupaddsvn # set a special user group for running svn. this operation is not required, but is recommended.
1.Yum install subversion# Install svn
2.Groupadd svn# Set a dedicated user group for running svn, which is not required, but is recommended
3.Useradd-g svn# Set a dedicated user for running svn, which is not required, but is recommended
4.Passwd svn# Set a password for the user who runs svn. this operation is not required, but is recommended.
5.Mkdir-p/var/svn# Create/var/svn as the root directory for centralized repo storage
6.Chgrp svn/var/svn; chown svn/var/svn# Handing over directories to svn users
7.Su-l svn# Switch to svn for subsequent operations
8.Mkdir-p/var/svn/default-repo# Create a folder for the code library to be created
9.Svnadmin create/var/svn/default-repo/# Create a code library,/var/svn/default-repo/is the folder where the code library is located
10.Cd/var/svn/default-repo/conf# Go to the conf Directory of the newly created code library and prepare for relevant configuration
11.Vim svnserve. conf# Configure authentication:
[Plain]View plaincopy
- Anon-access = read # Anonymous User readable
- Auth-access = write # authorized users can write
- Password-db = passwd # specify the account and password configuration file. by default, the file is located in the same directory as svnserve. conf, that is, conf /.
- Authz-db = authz # specify the permission configuration file. by default, the file is located in the same directory as svnserve. conf, that is, conf /.
- Realm = default-repo # authentication domain. this value will display the "authentication domain" name prompted during login. the default value is a UUID assigned to this version Library, we can set it to the version Library name.
12.
Vim passwd# Setting accounts and passwords
Add the user and password to the [users] block. Format: account = password, for example:
[Plain]View plaincopy
- [Users]
- Laurence = 123
13.
Vim authz# Set the user's read and write permissions. format:
Add at the end of the file:
[Plain]View plaincopy
- [/]
- Laurence = rw
[] Is used to define the target folder for which permissions are applied. this is set to the root directory.
Row 2: account = permission, r: Read, w: Write
14.Svnserve-d-r/var/svn/default-repo/# Start svn server (default port 3690)
Note: the same server can run multiple svnservers. you only need to change the port at startup: svnserve-d-r/var/svn/another-repo/-- listen-port 3691