Subversion for Windows Installation Guide [Pick]

xiaoxiao2021-03-05  23

Subversion for Windows Installation Guide

Postentee: AlexClark | Published: November 19, 2004, 13:38

Huanlin.tsai at msa.hinet.netRevision: 1.3 (AUG-17-2004)

Summary

This article provides a simple installation guide that describes the steps of installing the Subversion server in a Windows environment, and the installation steps of the TortoiseSVN user tool.

1 Introduction

Subversion is a version control system, which is designed based on the functionality of CVS (Concurrent Versions System), but has improved some of the shortcomings of CVS, for example: moving files in CVS is very inconvenient, Subverion is connected to the directory Incorporate version management; in addition, it also adds other functions, such as inextrous delivery (such as the concept of database transactions, when sending multiple files, if there is any file fails, all files sent this time Will not enter the archive of the archive), support a variety of online agreements, consistent file differences (no matter what file type, use binary difference alignment) .... and more.

Due to the current Subversion file, it is mainly for Linux users, so this file is specifically configured to install the Subversion in the Windows environment. I hope to help you quickly install the Subversion through this file. .

In the installation process, you will need to enter instructions of some command columns. I will not explain the use and significance of certain instructions, so you should read the Subversion's e-book (in Chinese version) in addition to the basic directive of DOS. To understand the use of the Subverion command column tool. Although the graphical interface is convenient, it is familiar with the use of the command column tool to allow you to get complete freedom.

1.1 Read the basic concept

If you lack the basic concept of the version control system, even if you can successfully install the Subversion, you may not know how to do it next after the installation is complete. It is only a simple to mention the necessary basic concepts, remember that you will eventually read the official document of the Subversion.

1.2 Work Environment and Software Version

Here is the author's work environment and software version to install Subverion:

Windows 2000 Server With SP4 Apache Http Server V2.0.50 Subversion V1.0.5 TortoiseSvn 1.0.6 Build 1200

2 Install and create a Subversion server

This section describes the steps required to install Subversion, prepare a stable machine, as a Subversion server.

2.1 Install Apache HTTP Server

To http://httpd.apache.org/ Download the Apache Http Server version 2.0 for Windows installation program, I downloaded the file is Apache_2.0.50-win32-x86-no_ssl.msi.

After downloading, the installation process is very simple, but you will not go out, but please check if your computer has installed IIS before installation, because the Apache preset uses 80 port, you will conflict with IIS website, you must put the IIS's Web The platform is turned off and then the Apache Http Server is installed.

After the installation is complete, open the browser, browse the website http://127.0.0.1/ See if there is a web page that appears successfully. 2.2 Install Subversion

To http://subversion.tigris.org/ Download the latest version of Subversion, you can download .zip or packaged automatic installation program, I downloaded the file svn-1.0.5-setup.exe. After downloading, install it directly, the installation process is next, nothing special. After the installation is complete, even the necessary environment variables help you set (if you download .zip file, you must set it yourself). Put

/ HTTPD / directory MOD_DAV_SVN.SO and MOD_AUTHZ_SVN.SO to

/ MODULES / directory. Put

/ bin / directory Libdb42.dll, libeay32.dll, and ssleay32.dll copy to

BIN or MODULES folder under the bottom. Then, use the instrument editor to open the httpd.conf of Apache Http Server.

/ conf / directory), find a bunch of loadModule instructions, first find the following two lines: #loadModule DAV_MODULE MODULES / MOD_DAV.SO # loadModule DAV_FS_MODULE MODULES / MOD_DAV_FS.SO Remove the front '#' character, then take the following line The text is added to the back of this group of loadModule instructions: loadModule DAV_SVN_MODULE MODULES / MOD_DAV_SVN.SOLOADMODULE Authz_svn_module modules / mod_authz_svn.so Restart Apache HTTP Server.

Problem exclusion If the Apache Http Server can't start, please check the following steps:

Check if the path of the Subversion has in the system's% PATH% environment variable. Check if the items you join httpd.conf are correct, remember MOD_DAV_SVN.SO and MOD_AUTHZ_SVN.SO must be loaded after other mod_dav * .so modules.

2.3 Set the path to the Subversion file

Now set the correspondence between the URL path and the archive entity path. There are two other ways, respectively, SvnPath and SvnParentPath, respectively.

2.3.1 svnpath

Svnpath is suitable for individual specifying the path to specify the file, the syntax is:

/ svn / repos_name>

DAV SVN

Svnpath / absolute / path / to / repository

The "/ svn / repos_name" is the URI (Uniform Resource Indentifier) ​​of the user end, and the path specified by SvnPath is the absolute path of the archive library. It is assumed that the path that is actually stored in our archive is d: / svn / MyProject, and I hope that the user uses "http: // myserver / svn / myprj" URL to access the archive, then the content to join httpd.conf is:

/ SVN / MyPRJ>

DAV SVN

Svnpath D: / SVN / MyProject

Note that the first slash of / svn / myprj behind the Location tag is indispensable!

2.3.2 SvnParentPath

If your archive is set under a directory, for example: D: / svn, you can use SvnParentPath to specify the root path of the archive library, for example: / svn>

DAV SVN

SvnParentPath D: / SVN

This means that anyone can access all files below the D: / SVN directory through the HTTP: // MyServer / SVN / . That is, this setting action only needs once. If you use svnpath, you must specify the corresponding path to each archive.

The above two sets of settings can be, convenient, here I use svnparentPath to unify the parent's parent URL path of all archive.

will

Setting up to the httpd.conf tail of Apache Http Server.

Then you can start building a file.

2.4 establish a file

Suppose we have to put all the archives in the D: / SVN directory, now build a file file, name is called in the Repository, the instruction is:

MD D: / SVN

Svnadmin Create D: / SVN / Repository

After the command is executed, check what directory and files have generated under the D: / SVN / Repository directory.

WARNING Archives must not be available on a storage medium built on any remote, such as a network disk.

At this time, you have established a archive, you can test it in this machine, the URL input http: // svn / repository, see if you can see the contents of the archive, normal words should be like the picture below .

If the above tests can pass, it should be fine. If you still want to test the entire work repository from the archive library, you can perform the following instructions (not necessary):

C:

CDTEMP

SVN Co http: // localhost / svn / repository Wholerepos

The above instructions are switched to a temporary directory C: Temp, and then remove the entire work repository from the archive library. The last line instruction is to perform the check out action (abbreviation CO) if it is correct, and if the correct, "Checked Out Revision 0." should be displayed. At this time, the / SVN / Repository is all the files under this archive. Take it, and copy one to the C: / TEMP / WHOLEREPOS directory.

Problem exclusion If the error message is displayed: SVN: PropFind Request Failed on '/ SVN / Repository'

SVN: PropFind of '/ SVN / Repository': 405 Method Not ALOWED (http: // localhost) Please check the httpd.conf file of Apache Http Server

Whether the location defined by the label is the same as the URL style you specified, pay attention to it exactly the same, in the above example, the last side of your httpd.conf should have the following text:

/ svn>

DAV SVN

SvnPath points to the absolute path of the archive

If the error message is displayed is: SVN: PropFind Request Failed on '/ SVN / Repository'

SVN:

COULD NOT OPEN THE REQUESTED SVN FILESYSTEM that does not find the reposiroty directory under the entity directory (ie, D: / SVN) corresponding to / svn. Note: PropFind is HTTP Method for WebDAV to get attributes from the resource. You can delete the Wholerepos directory throughout the test.

So far, it is possible to determine that the archive has been completed, and then you can return it.

2.5 Remission

You don't have to urge your existing formal project into archives, first create a project directory for testing. Let's build a projecta directory structure under C: / Temp, refer to the following instructions:

C:

CD TEMP

MD Projecta

MD Projecta / Trunk

MD Projecta / Branches

MD Projecta / Tags

SVN import. http:// localhost / svn / repository -m "initial repository layout"

Tip This article is the way of using the HTTP protocol when executing the SVN command so that we can see that the Subversion and Apache HTTP Server settings are correct, others can access the archive through the Internet. Of course, you can also use other agreements, for example: file: ///, if the final line instruction becomes: svn import. File: /// D: / svn / repository -m "initial repository layout"

If the command executes the error, you should see the following screen:

At this time, Projecta has been put into the archive, that is, other users can start to access the files and program code for this file. You can refer to the method of use of Svn.exe's user command column tools in the official manual of Subversion, plus the file, join the file, and deposit the file. In the process of practicing, there is a mistake, or the archive is disrupted, you can cut off the directory of the entire archive, return to 2.4 and re-do it.

The following will further discuss the arrangement of archives and project catalog structures. If you are eager to try to see how the subscriber is accessing the Subversion file, you can jump to 2.6 or section 3.

2.5.1 Configuration of Archives and Projects

Continuing the previous example, if you return to other items, such as Projectb, then the structure of the entire archive will turn this:

/ SVN / Repository /

- Projecta /

- Projectb /

That is to say, the repository contains two items in this archive.

If you want to establish a archive for each project, the instruction to establish a file in Section 2.4 is turned:

MD D: / SVN

Svnadmin Create D: / SVN / Projecta

Svnadmin Create D: / SVN / Projectb

This becomes two archives, the archive names are Projecta and Projectb, respectively.

Tip If there is a shared file between the project, it is recommended to put these related items into the same archive; if the items are not related to each other, then use a file to put a project, this way is equal to the project. Archive. The first way is a more strange "function" you should know that it is a project of Check in action, which will also increase the revision of the file file. If this is not what you want, please select the second Method, that is, a file is only stored. 2.5.2 Directory Structure

Here to supplement the directory structure of Projecta. The trunk, branches, and tags established in the root directory of the Projecta project are particularly meaningful, and their roles are:

Trunk directory is used to copy program files and files currently developed (also known as the main line, which are mainlineline); BRANCHES is used to store the branches of the main line; tags is used to store no longer change The branch, that is, the files will not be modified.

This is the Subverion's official manual recommended to directory structure, you can decide whether to use this configuration, please refer to the fifth chapter of the official manual, the child title is "Choosing a repository layout".

Tip Directory Name Recommendation Do not use the Chinese name so that it is more convenient to use the command column, and there will be no problem.

2.6 Verify using Windows domain account

Do this, do it, you will find an account password when you find an access archive, because our previous setting does not enable identity verification. But we usually don't want everyone to access your archives, lests from excessive assets, or the data is destroyed, so it is necessary to learn how to join identity verification.

Serversion provides a variety of ways to verify the user's identity. Here only describes how Windows identity verification, this way is suitable for use in the development team members in the area network. Please follow the following steps:

Get the SSPI module, download the URL to http://torToisesvn.tigris.org/mod_auth_sspi.zip. Unzip the mod_auth_sspi.so inside ZIP to

Under the modules directory. Add below to apache's httpd.conf: loadModule SSPI_AUTH_MODULE MODULES / MOD_AUTH_SSPI.so

Note that this line added above must be placed in front of the line below: LoadModule Auth_Module Modules / MOD_AUTH.SO

Modify httpd.conf

The setting is as follows:

DAV SVN

SvnParentPath D: / SVN

Authtype SSPI

Authname "Subversion Archive"

Require Valid-User

SSPIAUTH ON

SSPIAUTHORITATIVE ON

SSPIDOMAIN

Sspiofferbasic on

among them

It is your computer name (for example: win2kdc) of your Windows domain controller, pay attention to brackets in both sides <> do not reserve. If your environment has no domain controller, it maintained its original

Ok. In my environment, I found that even if there is a domain controller, but you will not set it, or you can verify the user's identity. Restart Apache.

Ok, now open the browser, enter the URL http://127.0.0.1/svn/repository to see, you expect the following verification screen: But there is no appearance, but directly display the archive content, what happened?

Because we are now using Windows account validation, you have already logged in this machine, and you have to access the resources of this machine, in other words, your identity has been verified, so you will not ask you again. Enter the account heel password, which is the benefit of using SSPI domain validation.

So, if your colleague John's computer is added to the domain, he usually logs in this unit, not the logo network, will you request an account password when accessing a file? The answer is that if John logs in him, the account and password of this machine is exactly the same as him, there is no need to enter the password again; the opposite, if you log in to the user's account and password and the domain user The account password is different, and the password must be entered when the first access is accessed.

You can access the Subverion archive library on a homemade, use the user account in one domain. If it is correct, you should appear on the window of the account password.

The above is only the most basic setting, if you want to do some advanced settings, such as allowing everyone to view the contents of the archive, but cannot be modified; or join the SSL encryption mechanism, I suggest you refer to [2] chapter.

When prompted to enable the identity verification, you will find that if you use the http: // protocol, some subcommad is executed with the http: //, some subcommman is executed, this time You can join --username and --password in the svn command to provide the user name and password, for example: svn co http: // myserver / svn / --username michael --Password Gueswhat or you can also use File: /// Agreement.

3 Install the user end: TortoiseSVN

Now you have a Subversion server, you can try to access files on other computers. If you are used to using the command column tool, just install Subversion on the client computer, the access file is through the command column tool (mainly svn.exe). Here, it is to introduce a Subversion user end specifically designed for a Windows job system: TortoiseSVN (hereinafter referred to as TSVN).

3.1 Install TortoiseSVN

To http://tortoisesvn.tigris.org/ Download the latest installation program, install it directly after downloading. Most of the installation process is pressed, only when you ask you, you will ask you to reboot. To http://tortoisesvn.tigris.org/ Download the language pack, please note that the version of the language pack should be the same as the TSVN version you installed, otherwise it is best not to install. After the language is packaged, use the file main tube to slide the mouse on the Windows desktop or any data clip, select TortoiseSvn -> Settings to turn on the setting window, change the language in the "Main" page set to "Chinese (Traditional) ", Press the" OK "button again. If you are accessing the Internet through Proxy Server, in the TSVN setting window, cut to the "Network" clip, then enter your Proxy Server Related Information, otherwise you will not be able to access the archive library located on the Internet. After the installation is complete, you can see the TSVN functional options in any directory name. This is also convenient to TSVN. It doesn't have to integrate with the development tool, but it is integrated with the operating system, so you use it. What development tools can easily use TSVN to access files.

Next, you can use TSVN to practice the previously established archive, try to put your existing project into the archive, and perform the take-out, deposit, update, etc. in the user end using TSVN.

Although TSVN is a user-end tool, it also provides a set of archive, and elaborate, remittance, so it is also very convenient to install it in the servo.

4 conclusion

According to the installation steps described in this article, I hope that you can install the Subversion in the Windows environment. But after the installation is successful, the real job should only begin if you don't spend some time to read the relevant documentation of the Subversion. In the process of using the version control system, you will be able to encounter a lot of problems.

Before you officially join your Subversion archive, it is recommended to think more:

The configuration method of archive library. Do you want to build a archive for every item, or put multiple items into the same archive? The structure of the project catalog. Do you want to establish trunk, branches, and tags in the root of the project in accordance with the official manual? What is going on in the archive?

The first two questions You can refer to the recommendations of [1] (Chapter 5), and then measure your needs to determine. You don't see the official suggestions, the first time I may use the most simple configuration method, for example: a file is only one project, and only put the original code of the program into the archive, nor to the main line The branch line is therefore the project's directory structure can be very simple, the root directory of the original original code is the root directory of the project. After you have done a few times, I will observe the content of the archives, and I will feel more feeling, and then consider the needs of my team, naturally I can find the most appropriate way to find my team.

postscript

When this document is over, it is found that [2] has provided a similar file, but since writing, still announced, Chinese resources are always good.

Network resource

[1] Subversion eBook. Http://svnbook.red-bean.com/ Traditional Chinese version: http://svn.ntcu.net/svnbook/ [2] TortoiseSvn official document. http://tortoises.tigris.org/docs.html#docdir[3]Http://svn.ntcu.net/kwiki/ Reprinted from: Cai Huanlin's article

转载请注明原文地址:https://www.9cbs.com/read-39253.html

New Post(0)