1. Install subversion:
The code is as follows: |
Copy code |
# Yum install subversion |
Check whether the installation is successful:
The code is as follows: |
Copy code |
# Svnserve -- version
|
II. Create a SVN database
The code is as follows: |
Copy code |
# Mkdir/home/svn # Svnadmin create/home/svn/project_1 |
For the sake of standardization, it is generally created in the project directory:
The code is as follows: |
Copy code |
# Mkdir-p/home/svn/projec_1/trunk
# Mkdir-p/home/svn/projec_1/tags # Mkdir-p/home/svn/projec_1/branches |
III. Configuration
Go to the conf folder generated above and configure the following files: authz, passwd, and svnserve. conf.
Among them, authz is permission control, which users can access which directories, passwd is used to set users and passwords, and svnserve is used to set svn-related operations.
2.1 set passwd first
The code is as follows: |
Copy code |
[Users] # Harry = harryssecret # Sally = sallyssecret Hello = 123
|
UserName = password
In this way, the hello user and 123 password are created.
2.2 set the permission authz again
The code is as follows: |
Copy code |
[/] Hello = rw |
This means that the hello user has read and write permissions on all directories, but it can also be limited.
If you use it on your own, read and write it directly.
2.3 finally set snvserv. conf
Anon-access = none # make unauthorized users inaccessible
Auth-access = write # grant the authorized user the write permission
Password-db = password
Authz-db = authz # access control file
Realm =/opt/svn/repos # authenticate the namespace. The subversion is displayed in the authentication prompt and serves as the key word cached by the credential.
Use the default configuration. The above statements must be written in the top level, and no space is left. Otherwise, an error will occur.
Now, with the above configuration, you can use svn.
4. Start the SVN service
The code is as follows: |
Copy code |
Svnserve-d-r/home/svn/ |
V. Use SVN
After the instance is started successfully, it can be used.
TortoiseSVN is recommended, and the connection address is svn: // ServerIp/project_1 (if the specified Port needs to be added: port number)
6. Stop the SVN service
# Killall svnserve