Article Title: Linux-based Subversion configuration. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
It took me one afternoon to learn about the Subversion configuration, which can be used normally after testing.
1. Installation
Yum install subversion
Ii. Configuration
The system uses the policy of creating a version library for each project. Configuration files, password files, and access control files are all stored in the conf directory of the version library.
Therefore, each time you start a new project, you must create a new version library and reconfigure the configuration files. It is also important to ask the team members to reconfigure the client, including the server version library path, local path, and other information.
1. Create a version library directory (multiple versions can be created. You must reconfigure the following items after creating the library. Note the differences between the installation directory and the version library directory. The following describes the version library directory)
Mkdir? P/home/svn/repos
# Similarly, you can create mkdir? P/home/svn/repos2/home/svn/repos3
2. Create the svn version Library (corresponding to the above directory)
Svnadmin create/home/svn/repos
After executing this command, svn automatically adds the required configuration file under the repos directory.
Note: unlike normal folders, creating a file directly on the operating system cannot be recognized by SVN. You must use commands such as import to import the file to the version library.
This is an internal svn command. create is used to create a version library. Use svn help to view detailed instructions.
3. Modify the version library configuration file
Vi/home/svn/repos/conf/svnserve. conf
The parameter functions are described in the remarks in the configuration file. The configuration is as follows:
[General]
Anon-access = none # Make unauthorized users inaccessible
Auth-access = write # grant the authorized user the write permission
Password-db = passwd # specify the password file path
Authz-db = authz # access control file
Realm =/home/svn/repos # authenticates the namespace. The subversion is displayed in the authentication prompt and serves as the key word cached by the credential.
Other default configurations are used. Each statement must be written in the top level, and no space is left. Otherwise, an error occurs.
4. Configure the user
Vi/home/svn/repos/conf/passwd
Enter the following content:
[Users]
Username1 = password1
Username2 = password2
You can add multiple user name and password pairs.
5. Configure permissions
Vi/home/svn/repos/conf/authz
This configuration file sets user authorization.
Including read-only r and read/write rw. Users not listed are not allowed to access. You can also group users. For details, refer to the svn Manual. The following is a simple example:
# Configure repository repos root directory permissions
[Repos:/]
User1 = rw
User2 = r
6. import files using import
The new version library is empty and you need to import the working directory.
// This statement imports the file found in the path/home/user/code to the Subversion repository you created.
Svn import/home/code/file: // home/svn/repos/-m "comment"
3. Start the service
Svnserve-d-r/home/svn/
Svn checkout svn: // ip/repos
Enter the user name and password.