I. Download and install Subversion
Official website of Subversion: http://subversion.tigris.org/
You can download the latest version of subversion from the official website. This tutorial uses Win32 version 1.1.4.
Download the Subversion Installation File and install it directly. Here, we assume that Apache has been installed on the system. In this way, when the Subversion is installed, it will automatically configure related modules to Apache.
Ii. Create and use a subversion repository.
$ Svnadmin create/path/to/Repos
Here, we assume that the svn1 and svn2 directories under the svn directory of the d drive are set as warehouses.
Svnadmin create d:/SVN/svn1
Svnadmin create d:/SVN/svn2
In this way, we can submit a file to it.
To use a repository, you must first set up the service. Let's wait for the server configuration to be discussed later.
Iii. Build a Subversion server
We use the Apache module.
First, load the required SVN module and modify the Apache configuration file httpd. conf:
Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule dav_module modules/mod_dav.so
Loadmodule authz_svn_module modules/mod_authz_svn.so
Configure the Repository:
<Location/SVN>
Dav SVN
Svnparentpath D:/SVN
</Location>
Then, configure the authentication method:
Here we use the authentication method of once Apache:
Htpasswd-CM d:/SVN-auth-file user1
Then, you will be prompted to enter the password, and a user will be added here. Then add another user:
Htpasswd-m d:/SVN-auth-file user2
Then modify the configuration:
<Location/SVN>
Dav SVN
Svnparentpath D:/SVN
Authtype basic
Authname "subversion repository"
Authuserfile D:/SVN-auth-File
Require valid-user
Authzsvnaccessfile D:/SVN-access-File
</Location>
Next, we need to write this svn-access-file, which is used to control the user's permission to access the repository. We will write the description below
[Svn1:/] // indicates the access permission under the root directory of the Repository svn1
Harry = RW // The svn1 repository. The Harry user has read and write permissions.
Sally = r // The svn1 warehouse Sally user has read permission
[Svn2: //] // access permission under the root directory of the svn2 Repository
Harry = r // The Harry user has only the read permission in the root directory of the svn2 repository.
Sally = // The Sally user does not have any permissions under the root directory of the svn2 Repository
# [/] // This indicates that it is in the root directory of all warehouses
# * = R // This indicates that all users have the read permission.
# [Groups] // This indicates group settings
# Svn1-developers = Harry, Sally // This represents a member of a group
# Svn2-developers = Sally
# [Svn1:/]
# @ Svn1-developers = RW // if you add the @ symbol above, it indicates this is a group permission setting
After this setting is complete. Restart Apache.
Http: // localhost/SVN/svn1
Http: // localhost/SVN/svn2
These two URLs are used to access the repository. Of course, to be restricted by permissions, you must be a legal user to access the repository and have the corresponding permissions.
The use of the client can be used through many Client GUI software. For example, tortoisesvn is very useful.
Official Website: http://tortoisesvn.tigris.org/
This article is from the csdn blog. For more information, see the source:
Http://www.po-soft.com/blog/xujianhua/152.html