Build Secure CVS using Apache and Subversion

Source: Internet
Author: User
Article Title: Apache and Subversion Build Secure CVS. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

As a new-generation open-source version control tool, Subversion has excellent features such as Directory versioning, atomic commit, versionized metadata, and more effective branch and tag, it is gradually receiving attention from the open-source software community and is expected to replace CVS and become the preferred system for Version Control in open-source software development. On the server side, the biggest uniqueness of Subversion is that it can be combined with Apache's HTTP server through an extension module to implement many advanced management functions and security features. Compared with CVS, Subversion provides more advanced and secure user authentication functions. With the support of Apache, users can access the version library through the HTTP protocol, the administrator can make specific settings on the user's HTTP access permissions, and the Subversion can also obtain SSL transmission encryption, user Data Encryption and directory-level access control.

This article will introduce the basic configuration and management of the Subversion server from the perspective of server configuration work and the author's configuration instances in actual development work, as well as how to combine Subversion with Apache, implement some advanced management functions.

Subversion Introduction

In the process of developing open-source software, due to the freedom of development methods and scattered development personnel, Version Control has always been an important issue related to the success or failure of the project. Without the support of the version control system, the development process of open source software is chaotic and uncontrollable.

For a long time, CVS, as a widely used open-source version control tool, plays an important role in many open-source software projects. In Eclipse, CVS is used as a default plug-in, which is tied together with Ant, JUnit, and other tools to become the basic tool for Eclipse software development. In recent years, with the development of the open-source community, a more powerful open-source version control tool has gradually entered people's field of view, that is, Subversion, with better features, subversion is gradually replacing CVS and becoming a new generation of open-source version control tools.

Compared with CVS, the directories, files, and renamed metadata in Subversion are all verticized, such as renaming and copying objects. In addition, the Subversion commit operations are inseparable, the revision version is based on each commit operation rather than a file. In addition, the Subversion can be run independently and has a lightweight Branching and Tagging operations, the version library can be stored in a database (Berkeley DB) or a file in a specific format to process binary files more effectively. Finally, the Subversion tool and related plug-ins have good international support, supports multiple language versions, including simplified Chinese, to help developers around the world. These outstanding new features make Subversion the best choice for the open-source community.

For common users, that is, application developers, especially for Eclipse users, the use of Subversion is very simple. Through the official Eclipse plug-in Subclipse, you can easily use the basic functions of the Subversion client in Eclipse. For more information about client settings and usage, see the official website of Subversion and the official website of Subclipse. Simply put, using the basic functions of the Subversion plug-in Eclipse, such as update, submission, synchronization, and branch is basically the same as using the CVS plug-in that comes with Eclipse, users can easily transfer from CVS to Subversion.

At present, the Subversion has been upgraded to Version 1.3.2. You can find the download, feature description, and detailed user manual on the Subversion homepage.

Simple version Library Management

With a simple and easy-to-use client, most users can easily use Subversion. However, as the server administrator, you must learn more about the basic configuration management of the server, to make full use of the excellent features of Subversion.

Create a version Library

The Subversion version Version Library (repository) is located on the server, where data is centrally managed and stored. In this article, we take Linux as an example to introduce the basic methods for configuring and managing the Subversion library on the server.

To create a version library, you must first determine which data storage method is used. In Subversion, there are two ways to store version database data: one is to store data in the Berkeley DB database, and the other is to use common files, it is stored in a custom format, called FSFS.

The two storage methods have their own advantages and disadvantages, readers can refer to the http://svnbook.org/the above document to understand the detailed comparison and difference between the two, here, we only reference the above document when a simple comparison table, A concise comparison is provided.


Table 1 Comparison between two versions of Database Data Storage
Features Berkeley DB FSFS
Sensitive to operation interruptions Sensitive; system crashes or permission issues can cause database congestion and regular recovery is required. Insensitive
Read-Only Loading No Yes
Storage platform independent No Yes
Accessible from network file systems No Yes
Version library size Slightly larger Slightly smaller
Scalability: Number of revision trees Unlimited Some local file systems may encounter problems when processing a single directory containing thousands of entries.
Scalability: Directory with many files Slow Slow
Speed of checking out the latest code Fast Yes
Massive submission speed Slow, but the time is allocated in the entire commit operation Fast, but the last long delay may cause the client operation to time out.
Group access management It is very sensitive to the user's umask settings, and it is best to only be accessed by one user. Insensitive to umask settings
Function Maturity 2001 2004

Determine the specific data storage type. You can create a Subversion library by executing the svnadmin command in the command line. The command is as follows:

# Create a folder $ mkdir/etc/svn/repos # Run the command to create a version library and specify the data storage as FSFS. If you want to specify it as Berkeley DB, replace fsfs with bdb $ svnadmin create -- fs-type fsfs/etc/svn/repos

If everything is normal, the command will return quickly without any feedback. In this way, a new version library will be created. Let's take a look at the generated version library structure:

$ Ls-l/etc/svn/repos total usage 56drwxrwxr-x 2 robert 4096 August 27 17:27 confdrwxrwxr-x 2 robert 4096 August 27 17:27 davdrwxrwsr-x 5 robert 4096 August 27 17:27 db-r -- r -- 1 robert 2 August 27 17:27 formatdrwxrwxr-x 2 robert 4096 August 27 17:27 hooksdrwxrwxr-x 2 robert 4096 August 27 17:27 locks-rw-r -- 1 robert 229 Aug 17 17:27 README.txt

The configuration files of the version library are stored in the conf directory, including user access control and permission control. The description of the file itself is very detailed. You can configure the files according to the annotations; the dav directory is the directory provided to related Apache modules. It is empty currently. The db directory stores all version-controlled data to be managed by Subversion, different Storage Methods (Berkeley DB or FSFS) have different directory structures. However, we generally do not need to directly modify or view the contents in this directory, the Subversion command can safely operate on this directory. In addition, the hooks directory stores hook scripts and templates (a version library event trigger Program), and the locks directory stores locked data in the Subversion library, the format file records the layout version number of the version library.

 

[1] [2] [3] [4] Next page

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.