Subversion configuration installation tutorial (1)

Source: Internet
Author: User
Tags apache log tortoisesvn
Introduction: I have always believed that Ms should learn useful things from open-source projects, and open-source projects should also learn from MS, rather than being mentioned on the Internet. net and Java are the same, and some of them are simple. ^ ...... ^ I have had the honor to be able to participate in multiple Java and.. Net project development. I often think about these two technologies. Now I have the opportunity to share with you what is wrong. Please give me more advice. First of all, I want to talk about SCM. I personally think that in today's large-scale software development, teamwork is one of the most important factors for project success, especially the use. net and Java, these powerful object-oriented language development programs, will inevitably be layered multiple times, component-based sharing and so on, so SCM is more important. I think you should have used Ms VSS and know the advantages and disadvantages of VSS. (Feng Chuan VSS was not developed by Ms. I remember that I visited the website of the company that actually developed VSS once, and now I forgot the address. In addition, Ms does not use VSS as its own SCM tool internally. I don't know if it is true ?) In future series of articles, I will explain subversion, CVS, the mainstream open-source project SCM tools, and will extend to Ci (continues integration, that is, continue integration) and bugtrace fields, after all, only the version control system is far from enough for the development of a large software. On this journey, I will also take you through Python (my favorite... Don't you want to try it? Very powerful !) And this series of articles will also be included in the using open source software to implement your. Net Applications (Chinese and English dual-language version, haha... Test your English ). First, we will introduce the subversion, which is introduced from SCID-Open System world by Gu hongjun.

For a long time, in the Open Source world, CVS (Concurrent Versions System) has always been the first choice for version control. But now the user has another option: subversion. Subversion is the next generation of version control system, can replace CVs, the project home page is http://subversion.tigris.org.

Subversion is a free and open source version control system. It is a common system that can be used to manage any type of files, including program source code.

It has a clear initial goal to implement most of the existing functions of CVS. It fully considers the existing CVS users, imitates CVS in usage, and develops a series of tools, this allows the CVS-based project to be smoothly migrated to the subversion. Compared with CVS, it has many advantages, such as directory version control, inseparable submission, consistent data processing methods, and more efficient branch and tag...

If you have used CVs, you will be able to understand the Subversion benefits mentioned above, such as directory version control and directory rename. For subversion atomic commit, I would like to say a few more words. As you can imagine, we generally make a change and may need to modify multiple files. In particular, many layers are becoming more and more appropriate, unless you are still using a language that writes everything together. (For example, Pb? It seems like this. I am currently migrating a legacy system. net, this system is to use a script language like Pb panther, UI, logic and data access all in one file, I also saw the 1980s note in the code. Haha, Is it strong? Several programmers in our company may be one of the few people in China who understand the Panther language. Too far ...) In a logical sense, if you have dropped some files for network reasons, hardware reasons, or even hardware reasons, this submission is incomplete, subversion atomic commit can solve this problem well. I personally think this is also the biggest improvement for CVs. How do you think about the concept of database transactions? Are you tempted? OK, let's go! (Follow me! Fire in the hole! ^ ...... ^)

Subversion has two running modes: Apache HTTP Server and subversion standalone server. Next I will explain the Subversion Based on Apache HTTP Server, which has several advantages: A. can use the WebDAV protocol. B. You can use a browser as a client tool to browse the source code repository. C. It is easy to support sspi (Windows domain authentication) and LDAP (AD ?), These are all supported by Apache itself. D. A comprehensive Apache Security Authentication System, such as SSL encrypted connections.

Before we officially install and configure the subversion, we will first make some preparations. Since we will often execute commands in the command line, each time we open a new command line window, the default current directory is C: \ Documents and Settings \ $ username. It is very troublesome to switch the directory before executing the command, so let's solve this problem first. In "start"-"run", enter "Regedit" to open the registry. Find \ hkey_classes_root \ Folder \ shell. If there is no shell, you can create a key named Shell under folder and a key named "command windows" under shell, create a new key named "command" under this key and set the default value to "CMD/k cd/d % L ".


The effect is as follows:


In this way, when we select a directory, a "command windows" option is added to the context menu, click this option to open a command line window and quickly switch to the selected directory. Many people are angry when talking about ms, but how many people really master MS technology? For example, we recommend that you enter "CMD/?" In the command line window /?", I believe there are many gains. Some time ago, when I was reading "Word's typographical art", many book reviews on China-Pub were dismissive, I don't know if these people really can use winword as their own "Writing platform "? In the past, I used dockbook as a writing tool. Now I know that word can be used like this, and MS is not useless...

Note: If you use WINXP as the Subversion server, install the SP1 Patch. Otherwise, the database of subversion cannot be used due to incorrect network data transmission. (My own notebook is WINXP SP2 and works well. As for Win2k, I don't think there is any problem ?)

Install Subversion:

1. Download Apache HTTP Server from www.apache.org. Be sure to download version 2.0.x or later. Otherwise, it cannot work with the latest subversion.

2. To http://subversion.tigris.org/servlets/ProjectDocumentList? Download the binary Installation File of subversion 1.1.3 on folderid = 91. Generally, tigris.org does not provide Binary packages. These Binary packages are maintained by volunteers, so they may not be the latest version. If you want to use the latest version of subversion, download the source code and compile it yourself.

3. install Apache HTTP Server

4. Install Subversion

5. Check whether mod_dav_svn.so and mod_authz_svn.so are available under $ \ apache group \ apache2 \ modules.

6. Check whether libdb42.dll is available under $ \ apache group \ apache2 \ modules,


7. search for $ \ apache group \ apache2 \ conf \ httpd. # loadmodule dav_fs_module modules/mod_dav_fs.so In the conf configuration file, remove the comment #, and check whether loadmodule dav_svn_module modules/modules and loadmodule authz_svn_module modules/modules are at the end of the loadmodule configuration section,


Note: install Apache first, and then install subversion. In this way, all steps 5, 6, and 7 are free of use. During the process of installing subversion, it automatically copies the corresponding files to the corresponding directory, and modify HTTP. CONF file, and then restart the apache service to make the modification take effect. However, I found that the current version of the Subversion installation file may have a bug, Apache's HTTP. the # loadmodule dav_fs_module modules/mod_dav_fs.so comment in the conf configuration file is not removed, so check carefully. If you install the Subversion before installing Apache, you must manually complete the preceding steps.

Configure Subversion:

1. Create the root directory of the source code library on the hard disk, for example, E: \ SVN

2. Create a new directory under E: \ SVN, such as testrepository as our test source code library

3. Create a subversion database. The current version of subversion supports two format databases: fsfs and bdb ). Enter svnadmin create -- FS-type bdb testrepository in the command line to create a database in bdb format (make sure the current directory has been switched to E: \ SVN \), enter svnadmin create -- FS-type fsfs testrepository in the command line to create a database in the fsfs format (ensure that the current directory has been switched to E: \ SVN \). After the database is created, go to E: \ SVN \ testrepository to check whether many directories and files are added. You can study these files to help you understand subversion, but do not try to modify these files directly!


If you pay close attention to open-source technologies, you will know that bdb is a lightweight relational database and can be used as a lightweight built-in database. It has many applications in many open-source projects, such as cvstrac. The primary feature of the fsfs format is that databases that support subversion and subversion servers can be on different physical machines and shared over the network (do not know if NFS is supported ?), It works well on MS WIN98 and is faster. However, because fsfs is a new format, the stability may not be better than bdb. We recommend that you use bdb. After all, bdb has many years of development history and is relatively stable. I think there is no need to separate the Subversion DB from the server? (Who can tell me the benefits of doing so ?), Won't you use Win98 as the server? ^ ...... ^. Do not try to use network sharing on a database in bdb format, or use Network Disk ing. Otherwise, unexpected errors may occur.

4. Open the configuration file $ \ apache group \ apache2 \ conf \ httpd. conf and add the following statement at the end of the file,

<Location/SVN>

Dav SVN

Svnparentpath E: \ SVN

Authtype basic

Authname "Subversion repositories"

Authuserfile passwd

# Authzsvnaccessfile svnaccessfile

Require valid-user

</Location>

A virtual directory http: // yourserver/SVN/is created here. All the source code repositories of subversion are in this virtual directory, use the username/password (username/password) list in the passwd file to access http: // yourserver/SVN /. The security configuration of subversion is an important part. I will leave it to the next time I configure an SSL encrypted connection.

5. Switch to $ \ apache group \ apache2 in the command line and run bin \ htpasswd-C passwd <username>. Here <username> is the username you want to add, such as Doudou. After the command is executed successfully, a passwd file will be created in the bin directory. if you add a new user and change the password of an existing user, run bin \ htpasswd passwd <username>.


Be sure to run the command under $ \ apache group \ apache2. In this way, the generated passwd file is under the root directory of $ \ apache group \ apache2, instead of the bin directory, apache searches for the passwd file in the root directory of $ \ apache group \ apache2 by default, if you run this command in the bin directory, cut the generated passwd file to the $ \ apache group \ apache2 root directory. This can also be seen from the Apache log,


6. Restart the apache service.

7. Enter http: // yourserver/SVN/testrepository in the address bar of the browser, enter the user name and password, and click OK. Subversion is now working properly.

When I wrote this article, I referred to tortoisesvn's help document. I would like to thank tortoisesvn for its outstanding work!

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.