Install and configure SVN server in Windows

Source: Internet
Author: User
Tags svn client

Preparations

First, download the svn server for Windows (you will use the search engine, so no download is provided.
Here I take the zip decompressed version of The svn-win32-1.4.3 as an example to extract it to the target directory, for example, I decompress it to the Subversion directory under the D disk
D:/subversion/bin is added to the system environment variable. If your decompression location is different from mine, set the environment variable according to your actual path.

Step 1: Create an SVN Database

 
Open a Windows Command Prompt and execute the command svnadmin create F:/SVN, svnadmin
Create is the command for creating the svn database, and F:/SVN is the location of your SVN database. Here I am just an example. You can decide the location of the svn database by yourself. After executing the above command
There will be an extra SVN directory under drive F, which contains several directories and files. The conf directory is used to store permission configuration, which will be described in detail later. The dav directory is used to provide to Apache and
Mod_dav_svn stores internal data. The DB directory is a data file of all version control, the hooks directory is used to place hook script files, and the locks directory is stored
The Subversion file library locks data to track the client that accesses the file library. format is a text file with only one integer in it, indicating the version number configured in the current file library.
You do not need to know what readme.txt is.

Step 2: Start the svn Server

 
Continue to run the svnserve-d-r command at the Windows Command Prompt
F:/SVN. The parameter-D serves as the backend service. The parameter-r specifies the root directory of the svn service. F:/SVN is the svn root directory, SVN service till now
You can use the svn client to test it.

Step 3: register the svn service as a system service

You may ask, isn't it necessary to input a command every time you start the svn server? How can I enable the svn server to automatically start when it is started? The answer is to register the svn service to a Windows system service and execute the command at a Windows command prompt.
SC
Create SVN binpath = "/" D:/subversion/bin/svnserve.exe/"-- service-R
F:/SVN "displayname =" SVN service "depend = TCPIP start =
Auto, is this command a little long? In fact, it is easy to understand that SC is a built-in system service registration tool for Windows. Microsoft Support Center

Submit
For detailed description, I will not repeat it here. The parameter binpath = "/" D:/subversion/bin/svnserve.exe /"
-- Service-R
F:/SVN "is similar to the command for manually starting the svn server? I just changed-D to -- service, which is not hard to understand, because it is a service now. Now, I have made a big success.
Yes. Try again.
PS: If you want to delete the svn service you just registered from the system service, you can use the SC delete SVN command.

Step 4: Set permissions

 
All of you are doing it. You don't need to talk about how important it is to set reasonable permissions for projects in R & D. Let's talk about developing games, the program department must have all the permissions of the source code directory and the art resource directory and
To obtain the directory of a planning project, the art department must have all the permissions of the art resource directory and the permission to obtain the directory of the planning project, the Planning Department must have all the permissions for the planning case directory and the permission to obtain the art resource directory.
Limits. Next, let's take a look at how SVN sets permissions. Remember the conf directory mentioned in the first step of creating the svn database. The conf directory contains three files, all of which are text files, usage
You can simply open them. Let's first look at the svnserve. conf file. The anon-access item specifies the operation permissions of unauthenticated users. It has three valid values:
Read, write, none, read is read permission, write is write permission, none is no permission, and password-DB is used to specify
File: The authz-DB item is used to specify the file for storing user permissions, and the realm item is used to specify the verification range, which is generally not used. The preceding four items are commented out by default. # No. Is Annotated
To use them, you only need to remove the annotator. The passwd file is the file that stores the user name and password by default. For example, if I set a sol user with a password of 111111
You can add Sol = 111111 under [users]. The authz file is the file specified to store user permissions by default. [groups] indicates the group. Here we set
Developer group. You only need to write developer = Sol under [groups ]. [/]
The root directory of the table. If we want to set the developer group to have full access permissions, add @ developer = RW below. The @ symbol in front of the table indicates the group. In addition, we allow everyone to have
Add * = r to the read permission list. SVN allows you to set permissions for each directory. The setting method is similar to that of the root directory. If you do not understand this, see the following example.

An example of permission Configuration

 
Let's take the game project development as an example. The project name is project1. How to create an SVN database as mentioned above? Create a project named project1 under the svn root directory.
For a local database, first configure the svnserve. conf file in the conf directory. We do not allow anyone unrelated to R & D to access this project. Therefore, anonymous access is prohibited for every R & D personnel.
Create a personal account. The permission file and account information file can be used with the authz file and passwd file in the same directory by default.

The svnserve. conf file is configured as follows:

[General]
Anon-access = none
Password-DB = passwd
Authz-DB = authz

 
Next, configure the passwd file and set up a personal account for each developer. Assume that the project owner is Sol, the program department is Tom and mark, and the art department is John, Alina,
The planning departments of Candice and Ellen include Terry and Jane. Here we set all the passwords to 000000 for convenience. Now, the example is okay. The password will be used in actual application.
It cannot be set at will.

The passwd file configuration is as follows:

[Users]
Sol = 000000
Tom = 1, 000000
Mark = 000000
John = 000000.
Alina = 000000.
Candice = 000000
Ellen = 000000
Terry = 1, 000000
Jane = 000000

 
All accounts have been created. Now they are assigned different permissions. First, set four groups: Manager.
, Developer, artist, designer, assign sol to the manager group, assign Tom and mark to the developer group, and
John, Alina, Candice, and Ellen are assigned to the artist group, Terry and Jane are assigned to the designer group, and we will create
The four directories: designs, sources, resources, and reports. Then, create a directory named after your account in the reports directory for everyone.
Put everyone's work report, the manager group has the read and write permissions for all directories, the developer group has the read and write permissions for the sources directory, and
The read permission of the Resources Directory. The Artist Group has the read and write permissions of the Resources Directory and the read permission of the designs directory. The designer group has
The read and write permissions of the designs directory and the read permissions of the Resources Directory. Each account has the read and write permissions of the directory named by its own account under the reports directory, that is, each
Only the project owner and the owner can view the work report of the person.

The configuration of the authz file is as follows:

[Groups]
Manager = Sol
Developer = Tom, Mark
Artist = John, Alina, Candice, Ellen
Designer = Terry, Jane

[Project1:/]
@ Manager = RW
* = R

[Project1:/designs]
@ Manager = RW
@ Developer = r
@ Artist = r
@ Designer = RW
* =

[Project1:/sources]
@ Manager = RW
@ Developer = RW
* =

[Project1:/resources]
@ Manager = RW
@ Developer = r
@ Artist = RW
@ Designer = r
* =

[Project1:/reports/SOL]
Sol = RW
* =

[Project1:/reports/Tom]
@ Manager = RW
Tom = RW
* =

[Project1:/reports/Mark]
@ Manager = RW
Mark = RW
* =

[Project1:/reports/John]
@ Manager = RW
John = RW
* =

[Project1:/reports/Alina]
@ Manager = RW
Alina = RW
* =

[Project1:/reports/Candice]
@ Manager = RW
Candice = RW
* =

[Project1:/reports/Ellen]
@ Manager = RW
Ellen = RW
* =

[Project1:/reports/Terry]
@ Manager = RW
Terry = RW
* =

[Project1:/reports/Jane]
@ Manager = RW
Jane = RW
* =

 
Directory permissions have been set up, but we have not yet created the directory. Now only the project owner has the permission to create the directory under the project root directory, so we use the sol account to create the designs,
Reports, resources, and sources directories, and then create a work report directory named by your account in the reports directory.
All done. Close the job.

 

 

From: http://grindelwald.iteye.com/blog/249797

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.