Installation and configuration of subversion under Linux platform (i) __linux

Source: Internet
Author: User
Tags bz2 mkdir svn

This article describes how to use the Linux Environment ( Redhat9 , for example) through Subversion to build the most important version control environment in the team development process, including Subversion The installation configuration of the environment, as well as the configuration and use of the client. (some operations, such as make install require root permissions, for simplicity, and in the absence of special instructions, the following work is used Root account complete. )

1. Install Apache HTTP Server

HTTPD is a Web server, httpd and subversion, can be used to access subversion through the Web, get httpd-2.2.4.tar.bz2 file, after the following command decompression:

TAR-JXVF httpd-2.2.4.tar.bz2

After entering the unpacked directory, execute

./configure--enable-dav--enable-so--enable-nonportable-atomics

Among them,--enable-dav allows Apache to provide DAV protocol support;--ENABLE-SO allows the DSO module to be loaded at runtime --enable-nonportable-atomics can enable more efficient atomic operations based on mutex execution on more than 486 CPUs. The first two parameters must be added, and you can add additional parameters depending on your needs. The httpd default installation directory is/usr/local/apache2 and can be specified by the--prefix parameter.

In addition, some howto on the network use the--enable-maintainer-mode parameter at this time, it is recommended that you do not use it in a formal use environment, this parameter compiles the source code with all warnings and debug symbols, which can affect performance.

When you are done, compile httpd with the Make command, and perform make install to complete the installation of httpd, the default path is/usr/local/apache2.

After the installation is complete, enter the/usr/local/apache2/bin directory and use

./apachectl start httpd

Open http://localhost/in the browser if "It works" is displayed correctly. ", then the proof has been installed successfully.

2. Install Subversion

Subversion installation is slightly tricky and needs to be downloaded subversion-1.4.3.tar.bz2 and subversion-deps-1.4.3.tar.bz2 two compressed packets, and extract to the same directory, so subversion will automatically compile and install the dependent library, if the habitual installation of the dependent library, after the installation of subversion, The compilation of a dependent library needs to be done manually.

Go to the unpacked directory and execute

./configure--with-apxs=/usr/local/apache2/bin/apxs--with-apr=/usr/local/apache2--with-apr-util=/usr/local/ Apache2

Where--with-apxs is used to generate the MOD_DAV_SVN and MOD_AUTHZ_SVN modules of the Apache httpd; the--with-apr and--with-apr-util= parameters point to the Apache installation root directory instead of using the default SVN installation package with the APR, otherwise if you install a different version of Apache may cause the APR library does not match, appear similar:

Can ' t set position pointer in file '/SVN/TEST/DB/REVS/1 ': Invalid argument error. (The installation directory can also be specified with the--prefix parameter)

After the Configure completes, perform the make and make install commands to complete the installation.

After subversion compilation is completed, it is automatically added to the/usr/local/apache2/conf/httpd.conf

LoadModule Dav_svn_module modules/mod_dav_svn.so

LoadModule Authz_svn_module modules/mod_authz_svn.so

These two lines, and the generated mod is installed into the Apache2 modules directory.

3. Create repository

 

Suppose we set up the repository in the/home directory, then execute mkdir repository The new version Library folder,

You can create a version library named Test by using the svnadmin create repository/test command.

If the creation succeeds, the installation of subversion is completed successfully.

Here, I use the FSFS database format, which is the default data storage form for subversion, and if you want to use Berkeley DB as a database format, you need to install Berkeley DB before you install subversion. and use the-WITH-BERKELEY-DB parameter when compiling subversion, and then you can use the

svnadmin Create--fs-type BDB repository/test command to create a version library. (For a comparison of the two, refer to version control with Subversion (the Chinese title is "Versioning with Subversion"), chapter 5th).

4. Import Source code

 

Now that we've got a library of available versions, we'll use

The mkdir–p import/{trunk,branches,tags} command creates a new folder named import under the/home/svnroot directory, containing trunk, Branches , tags three subdirectories, directory structure as shown in the following figure.

As for why, you can refer to version control with Subversion 4th chapter.

Some dir

|---import

|---trunk

|---branches

|---tags

The following statement will import directories and files under the path/home/svnroot/import into the Subversion repository you created.

The revised version after submission is 1.

svn import/home/svnroot/import file:///home/svnroot/repository/test m "Init repository"

Here/home/svnroot/import can use relative paths, but file:///home/svnroot/repository/test must be represented as absolute paths.

5. Version library owner and permissions modification

 

Currently, the repository directory is still owned by the root, the default permissions are 755, in order for users to be able to read and write the directory through Apache, we need to first of all the directory and the directory of the upper-level directory Svnroot to the Apache HTTPD (When you install Apache httpd, you automatically increase the Apache user group and Apache users), and then, for security purposes, re

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.