Install it in redhat9 Linux and configure subversion 1.3.1

Source: Internet
Author: User

Install it in redhat9 Linux and configure subversion 1.3.1 (revision)

By: Wu Yin
Date: 2006-06-30
Email: Lazy_fox # msn.com
Copyright information: This article is copyrighted by Wu Yin. It can be freely transmitted and replicated for non-commercial purposes.
For commercial purposes, any behavior in this article shall be approved by the author.
Contact info: lazy_fox # msn.com











1. This document requires two files: httpd and subversion.
· Httpd is a web server used to access subversion through the Web. It is an official website and its download webpage,
Download httpd-2.2.2.tar.bz2.
· Subversion is the main character of this Article. Here is his official website and its download page,
Download subversion-1.3.1.tar.bz2
2. Create a user: svnroot
It is best not to involve the root user in SVN permission management and daily operation and maintenance. However, the following installation and configuration operations must be completed by the root user, some operations can only be performed by the root user.
3. Compile and install httpd (root user operation ):
// Decompress the apache2 installation package
# Tar xvzf httpd-2.2.2.tar.gz
// Enter the decompressed directory
# Cd httpd-2.2.2
// Configure Apache installation. The first two parameters must be added. You can also add other parameters as needed.
// Specify the following parameters. Where do you want to install Apache?
#./Configure -- enable-Dav -- enable-so -- prefix =/usr/local/apache2/
# Make
// Install
# Make install
# Cd/usr/local/apache2/bin
// Start the apache service
#./Apachectl start
// Open the browser http: // localhost/if there is a test page "It works! "The installation is successful.
4. Install Subversion
// Decompress the Subversion installation package (perform the following operations as the root user)
# Tar xvzf Subversion-1.3.1.tar.gz
// Enter the decompressed directory
# Cd subversion-1.3.1
// Configure subversion for Installation
#./Configure -- With-apxs =/usr/local/apache2/bin/apxs -- prefix =/usr/local/Subversion
-- With-Apr =/usr/local/apache2 -- With-Apr-util =/usr/local/apache2 -- With-SSL -- With-zlib
-- Enable-maintainer-Mode
# Make
// Install
# Make install
// Create the directory where the library file is located (the svnroot user performs the following operations)
# Mkdir/home/svnroot/Repository
// Enter the bin directory of subversion
# Cd/usr/local/subversion/bin
// Create a repository "test"
#./Svnadmin create/home/svnroot/Repository/test
# Cd/home/svnroot/Repository/test
// Check if there are more files. If yes, the Subversion is successfully installed.
# Ls-l
# Cd/usr/local/subversion/bin
// This statement imports the files found in the path/home/user/import to the Subversion repository you created,
// The submitted revision is 1.
#./SVN import/home/user/import file: // home/svnroot/Repository/test-M "comment"
// Do not allow others to have permission for this directory
# Chmod 700/home/svnroot/Repository
5. Modify the Apache configuration file
# Cd/usr/local/apadche2/bin
// Start Apache
#./Apachect1 start
# Vi/usr/local/apache2/CONF/httpd. conf
// Add at the bottom
Loadmodule dav_svn_module modules/mod_dav_svn.so
Loadmodule authz_svn_module modules/mod_authz_svn.so
<Location/SVN>
Dav SVN
Svnparentpath/home/svnroot/Repository // SVN parent directory
Authzsvnaccessfile/home/svnroot/Repository/authz. conf // permission configuration file
Authtype basic // set the connection type
Authname "subversion. zoneyump" // connection box prompt
Authuserfile/home/svnroot/Repository/AuthFile // user configuration file
Require valid-user // which authentication is used
</Location>
// Where AuthFile is passed
"Htpasswd [-C]/home/svnroot/Repository/AuthFile Username Password"
// To create
// "Require valid-user" tells Apache that all users in AuthFile can access Apache. Without it,
// Only the first user can access the new database
6. Restart Apache

#./Usr/local/apache2/bin/apachectl restart
// Open the browser to access http: // localhost/SVN/test/. If the display is displayed in the east-west corner, the operation is successful.
7. Permission management
1) Add users
# Htpasswd [-C]/home/svnroot/Repository/AuthFile wooin
// Use-C to create a new user file when setting the user for the first time. Press enter and enter the user password,
// Add the user
# Htpasswd AuthFile username (Add a new user)

2) Permission assignment

# Vi/home/svnroot/Repository/authz. conf
[Test:/] // indicates the access permission under the root directory of the test warehouse.
Wooin = RW // The test warehouse wooin user has read and write permissions
Bao = r // test repository Bao users have read permission
[Test2: //] // access permission under the root directory of the Test2 Repository
Wooin = r // The wooin user has only the read permission in the root directory of the Test2 repository.
Bao = // The Bao user does not have any permissions under the root directory of the Test2 repository.
[/] // This indicates that it is in the root directory of all warehouses
* = R // This indicates that all users have the read permission.
# [Groups] // This indicates group settings
# Svn1-developers = wooin, Bao // This indicates a member of a group
# Svn2-developers = wooin
# [Svn1:/]
# @ Svn1-developers = RW // If the @ symbol is added to the front, it indicates that this is a group permission setting

After this setting is complete. Restart Apache.
Http: // localhost/SVN/test
This URL is used to access the repository. Of course, restricted permissions must be valid to access the repository.

8. Notes:
1. SVN checkout http: // localhost/SVN/Hello. World

2. When SVN commit is used, the environment variable $ svn_editor = VI of the default editor needs to be set manually. It seems that there is a problem with Kate.

3. If the logon username and password of Linux are the same as one of SVN username and password, you will not need to enter the username and password for checkout. For example, Linux has a user named wooin, SVN also has a user named wooin, And the passwords are the same. When wooin is used to log on to Linux and run checkout, the source code file can be extracted directly, do not enter authentication information.

4. Several permissions are involved in SVN usage: file system permissions, Linux system permissions, SVN user permissions, and Apache process permissions.

File System permissions, Linux system permissions: the same meaning is that the folder and file access permissions are usually used in Linux. When creating a repository, folder, and configuration file in SVN, use the svnroot user and set the repository permission to 700. Other users are not allowed to view the permissions directly through the file system and can only be managed by the svnroot user.

Apache process permissions: because all the operations transmitted with the repository are performed through the Apache process, even if you have set a lot of permissions for SVN users, however, the Apache process does not have the permission to access the repository or related files. The permission of the Apache process is set at/usr/local/apache2/CONF/httpd. in the conf file, find the two lines in the file:

User daemon # Change daemon to svnroot to run the Apache process as svnroot.
Group daemon

SVN User Permissions: the permissions set in the authz. conf file are used by SVN to manage repository access permissions.

5. The SVN server can be configured in two ways: HTTP and svnserve. The HTTP method is introduced here.

6. Set some work to be done during SVN startup at the end of/etc/profile

# Start Apache server for SVN
/Usr/sbin/apachectl start
Export svn_editor = vi

7. when installing SVN, APR libraries should specify the -- with-Apr = and -- With-Apr-util = parameters to the root directory (serverroot) of Apache installation, instead of using the APR that comes with the default SVN installation package. Otherwise, if the apache version you install is different, the APR library may not match, and the following error occurs:
Can't set position pointer in file '/SVN/test/DB/revs/1': invalid argument error.
Updated -- for example, if you installed Apache 2.2.0, you must specify
The -- With-apxs and -- With-Apr parameters are stored in your apache2.2.0 installation directory:
./Configure -- prefix =$ {subversioninstallfolder }/
-- With-apxs =$ {apacheinstallfolder}/bin/apxs/
-- With-Apr =$ {apacheinstallfolder }/
-- With-Apr-util =$ {apacheinstallfolder }/
-- With-SSL/
-- With-zlib/
-- Enable-maintainer-Mode

9. Redeploy SVN Repository
You need to export a current Warehouse and import it to another warehouse (you can import it to the specified directory of the warehouse ),
Use the following command:
// Export all versions to the STN. Dump File
# Svnadmin dump/home/svnroot/sonatina/> STN. Dump
// Or you can export only one version.
# Svnadmin dump/home/svnroot/sonatina/-- revision 10> STN. r10.dump
// Or you can export multiple versions, such as versions 0-10
# Svnadmin dump/home/svnroot/sonatina/-- Revision 0: 10> STN. r0-10.dump

// Import it to the sonatinab/trunk directory. If -- parent-DIR is not specified, it will be imported to the root directory sonatinab /.
# Svnadmin load/home/svnroot/sonatinab/-- parent-Dir trunk <10. r0-10.dump

10. Xxx
11. Xxx
References:
1. SVN
2. Subversion version Manager configuration instructions
3. About subversion installation, configuration, and permission management
 
   
   
   
   
   
   
   
   
   
   

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.