SVN server construction and Configuration

Source: Internet
Author: User
Tags svn client tortoisesvn

1, download the latest version of SVN server such as Setup-Subversion-1.6.15.msi address: <! -- File Download http://download.csdn.net/source/3311549
--> (Sometimes in Windows2003 can not be opened with the VisualSVN-Server-2.1.3.msi interface flowers SVN service address http://download.csdn.net/source/3311669
)
2. download the latest version of SVN client such as TortoiseSVN-1.6.12.20536-win32-svn-1.6.15.msi address: http://download.csdn.net/source/3311621
(Corresponding Chinese package LanguagePack_1.6.12.20536-win32-zh_CN.msi address: http://download.csdn.net/source/3311559
)
3. Create an empty folder on the disk, such as D:/Repository.
4. Create multiple empty subfolders in the repository folder if group1, group2, group3. .. for future grouping.
5,

I. Preparations

1. Obtain the Subversion server program

Download the latest server installer from the official website (http://subversion.tigris.org. The latest version is 1.5.
In: http://subversion.tigris.org/servlets
/Projectdocumentlist? Folderid = 8100 & expandfolder = 8100 & folderid = 91

2. Obtain the tortoisesvn client program

Get the latest tortoisesvn from the official website http://tortoisesvn.net/downloads. Tortoisesvn
Is a client program used to communicate with the subvers server. Subversion comes with a client program svn.exe, but tortoisesvn
Improved operation and efficiency.

Ii. Install the server and client

Install the subversion (SVN) server and client. The downloaded Server is a zip package, which can be decompressed directly. For example, I can decompress the package to E:/subversion. The Client installation file is an EXE executable file. You can directly run the file and follow the prompts to install it. After the Client installation is complete, the system prompts you to restart.

3. Create a version Library (repository)

To run the Subversion server, you must first create a version Library (repository ). The version library can be seen as a place where data is centrally stored and managed on servers.

Create a version library. First, create an empty D:/repository folder as the root directory of all version libraries. Then, go to the command line and switch to the bin directory of subversion. Run the following command:

Svnadmin create d:/Repository/group1

This command creates a version library group1 Group1 under E:/SVN. Some folders and files are automatically generated.

We can also use tortoisesvn to perform this step graphically:

First, create an empty Directory D:/Repository/group1. Be sure to leave it empty. Then in group1
On the folder, "right-click-> tortoisesvn-> Create Repository
Here... ", then you can select the version library mode. Here you can use the default fsfs, and then create a series of folders and files, which are the same as those created in the command line.

4. Run an independent server

At this time, the Subversion service has not started yet, but the version library has been created through its command. Enter the following in the Command window:

D:/> svnserve-D-r d:/Repository

5. Configure users and permissions

1. Open the Directory D:/Repository/group1/conf in a text editor and modify svnserve. conf:

1) Modify server. conf
Set:

# Password-DB = passwd

Changed:

Password-DB = passwd

Set:

# Anon-access = read

Changed:

Anon-access = none
2) modify the passwd file

Remove the # annotator. Note that there is no space before it.

Set:

[Users]
# Harry = harryssecret
# Sally = sallyssecret

Changed:

[Users]
Lisi = Lisi (this is the username and password set by the Administrator)
Zhangsan = zhangsan (this is the username and password set by the Administrator)
3) modify the authz File

Set:
[Groups]
# Harry_and_sally = Harry, Sally

# [/Foo/bar]
# Harry = RW
# * =

# [Repository:/Baz/fuz]
# @ Harry_and_sally = RW
# * = R

Changed:
[/]
Lisi = RW (set the permission of the Lisi user to be readable and writable to the group1 database in this group)
Zhangsan = RW (set the permissions of the zhangsan user to be readable and writable to the group1 database in this group)

* =

2. Open the D:/Repository/conf directory in the text editor and modify svnserve. conf:

Set:

# Password-DB = passwd

Changed:

Password-DB = passwd

Set:

# Anon-access = read

Changed:

Anon-access = none

Set:

[Users]
# Harry = harryssecret
# Sally = sallyssecret

Changed:

[Users]
Admin = Admin
Lisi = Lisi (this is the username and password set in group1)
Zhangsan = zhangsan (this is the username and password set in group1)

1) Modify server. conf
Set:

# Password-DB = passwd

Changed:

Password-DB = passwd

Set:

# Anon-access = read

Changed:

Anon-access = none
2) modify the passwd file

Remove the # annotator. Note that there is no space before it.

Set:

[Users]
# Harry = harryssecret
# Sally = sallyssecret

Changed:

[Users]
Admin = Admin
Lisi = Lisi (this is the username and password set in group1)
Zhangsan = zhangsan (this is the username and password set in group1)
3) modify the authz File

Set:
[Groups]
# Harry_and_sally = Harry, Sally

# [/Foo/bar]
# Harry = RW
# * =

# [Repository:/Baz/fuz]
# @ Harry_and_sally = RW
# * = R

Changed:
[Groups]
Group_admin = Admin
Group1 = Lisi, zhangsan
[/]
@ Group_admin = RW
* =
[/Group1]
@ Group1 = RW
* =
3. The first and second steps must be performed for the two or more groups.
Vi. initialize Import

The following describes how to import our data (project) to this version library and manage our data in the future. Any of our changes are recorded by the version library. Even if we lose or correct the data, the version library can help us retrieve the data.

For example, I have a guestbook folder under D:/wwwroot, which stores the message book program I wrote. In this folder, right-click
Tortoisesvn-> Import... ", in the" URL
Input "SVN: // localhost/group1" in repository ". In "Import message", enter "import entire message book" as the comment.
After clicking OK, enter the account. Enter Lisi in both the user name and password. After completion, all content in the guestbook is imported to SVN: // localhost/group1/guestbook.

We can see that there is no change in D:/Repository/group1, and a guestbook is connected.
The folder is not created. The only change is that the capacity of D:/Repository/group1 increases. In fact, the content in the source guestbook has already been imported into repos1.
The version library is ready, and the source guestbook folder can be deleted.

Note that this step can be performed on another client with tortoisesvn installed. For example, if the IP address of the host running svnserve is 133.96.121.22, the content entered in the URL section is "SVN: // 133.96.121.22/group1 ".

VII. Basic operation procedure

1. Check out)

Extract the version library to a working copy:

To any empty directory, such as creating an empty folder F:/work in partition F. Right-click and choose SVN checkout ". In the URL
Enter "SVN: // localhost/SVN/repos1/Guestbook" in repository, so that we can get a copy.
A copy of the content in the guestbook.

2. Check in/commit)

Make changes in the work copy and submit:

In the copy of the guestbook job, open a file and modify it. Right-click and choose SVN commit ...". In this way, the modifications are submitted to the version library, which stores the submitted data as needed.

Right-click the modified file and choose tortoisesvn> show log to view all submissions to the file. In different
On the revision entry, right-click and choose compare with working copy.
Revision version differences.

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.