Installing the SVN management tool under Redhat as
[Date: 2008-02-16] |
Source: Linux Commune Author: Lansh |
|
Subversion (SVN), the emerging version of management tool in recent years, is the successor of CVS.
SVN server has 2 modes of operation: Standalone server and Apache. Each of the 2 ways has its pros and cons.
SVN stores version data in 2 different ways: BdB and Fsfs. Because the BDB way in the server interruption, it is possible to lock the data (I am in the LDAP when the damage, can not be cured), so it is safer to Fsfs way.
1. SVN Server Installation
Operating system: Redhat Linux AS4
Install package Get:
Download http://subversion.tigris.org/downloads/subversion-1.4.0.tar.gz and http://subversion.tigris.org/downloads/ Subversion-deps-1.4.0.tar.gz.
Compile:
Log in as root user.
Upload subversion-1.4.0.tar.gz and subversion-deps-1.4.0.tar.gz to the server.
Tar xfvz subversion-1.4.0.tar.gz
Tar xfvz subversion-deps-1.4.0.tar.gz
CD subversion-1.4.0
./configure--PREFIX=/OPT/SVN--without-berkeley-db–with-zlib
(Note: Run in Svnserve mode without Apache compilation parameters.) Store the version library in FSFS format without compiling berkeley-db)
Make clean
Make
Make install
Vi/etc/profile, at the end of/etc/profile joined:
Path= $PATH:/opt/svn/bin
Export PATH
Test:
Svnserve–version
If the display is as follows, the installation is successful:
Svnserve, Version 1.4.0 (r21228)
Compiled OCT 12 2006, 10:18:56
Copyright (C) 2000-2006 collabnet.
Subversion is open source software, http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository back-end (FS) modules are available:
* Fs_fs:module for working with a plain file (FSFS) repository.
(AOYO:REDHAT5 default installation installed 1.4.2)
2. SVN configuration
Build a version library directory to build multiple:
Mkdir-p/OPT/SVNDATA/REPOS1
Mkdir-p/opt/svndata/repos2
To build a version library:
Svnadmin CREATE/OPT/SVNDATA/REPOS1
Svnadmin Create/opt/svndata/repos2
To modify a version library profile:
Version Library 1:
Vi/opt/svndata/repos1/conf/svnserve.conf
Content modified to:
[General]
Anon-access = None (Aoyo: Do not set to read, otherwise report SVN "not authorized to open the root for edit operation")
auth-access = Write
Password-db =/opt/svn/conf/pwd.conf
Authz-db =/opt/svn/conf/authz.conf
Realm = Repos1
Version Library 2:
Vi/opt/svndata/repos2/conf/svnserve.conf
Content modified to:
[General]
Anon-access = None (Aoyo: Do not set to read, otherwise report SVN "not authorized to open the root for edit operation")
auth-access = Write
Password-db =/opt/svn/conf/pwd.conf
Authz-db =/opt/svn/conf/authz.conf
Realm = Repos2
That is, except realm = Repos2, the other configuration files are identical to the version Library 1 profile. If there are more versions of the library, and so forth.
(Aoyo: Note To remove the # and spaces together, or you will report "option expected" error)
To configure which users are allowed to access:
Vi/opt/svn/conf/pwd.conf
To simplify the configuration, the 2 version libraries share 1 user profiles. If necessary, can also be separated.
Note: Changes to the user profile take effect immediately, and you do not have to restart SVN.
The file format is as follows:
[Users]
< user 1> = < password 1>
< user 2> = < password 2>
Of these, [users] are required. The following lists the users who will access SVN, one line per user. Example:
[Users]
Aoyo = 123456
Test = 123456
To configure user access rights:
Vi/opt/svn/conf/authz.conf
To simplify configuration, the 3 version libraries share 1 rights profile/opt/svn/conf/pwd.conf. If necessary, can also be separated. The user group and version Library directory permissions are defined in the file.
Attention:
* The user name that appears in the permissions profile must already be defined in the user profile.
* Changes to the permissions profile take effect immediately, and you do not have to restart SVN.
User group format:
[Groups]
< user group name > = < user 1>,< user 2>
Of these, 1 user groups can contain 1 or more users, separated by commas.
Version Library catalog format:
[< Version Library >:/project/directory]
@< user Group Name > = < permissions >
< user name > = < permissions >
Some of the box numbers can be written in several ways:
/, representing the root directory and below. The root directory is specified when the Svnserve is started, and we specify/opt/svndata. This way,/means to set permissions on all versions of the library.
repos1:/, to set permissions on version library 1
Repos2:/occi, which indicates that permissions are set on the OCCI project in version Library 2
REPOS2:/OCCI/AAA, to set the AAA directory permissions for the OCCI project in version Library 2
A permission principal can be a user group, user, or *, and the user group adds @,* to the front to represent all users. Permissions can be W, R, WR, and NULL, and NULL means no permissions.
Example:
[Groups]
admin = Aoyo
[/]
@admin = RW
[REPOS1:/OCCI/AAA]
Test = RW
[Repos2:/pass]
Test = R
Delete unwanted files:
Rm/opt/svndata/repos1/conf/authz
rm/opt/svndata/repos1/conf/passwd
Rm/opt/svndata/repos2/conf/authz
rm/opt/svndata/repos2/conf/passwd
3. Start SVN
Set up users to start SVN:
Useradd SVN
passwd SVN
Follow the prompts to set the password for the user svn
Allow users to SVN access to the version library:
Chown–r Svn:svn/opt/svndata
Chown–r Svn:svn/opt/data
Start SVN:
Su-svn-c "svnserve-d--listen-port 9999-r/opt/svndata"
which
SU–SVN says to start SVN as the user svn
-D indicates running in daemon (background run)
--listen-port 9999 means using 9999 ports, you can replace them with the port you need. Note, however, that using ports under 1024 requires root permissions
-r/opt/svndata specifies that the root directory is/opt/svndata
Check:
Ps–ef|grep Svnserve
If it appears as follows, the start is successful:
SVN 6941 1 0 15:07? 00:00:00 svnserve-d--listen-port 9999-r/opt/svndata
4. Start SVN in service mode
In File/etc/services
Add a line:
SVN 3690/tcp # SVN
In the folder/etc/xinetd.d/create the file svn, content for
Service VNC
{
Disable = no
Socket_type = Stream
protocol = TCP
wait = no
user = root
Server =/usr/local/bin/svnserve
Server_args =-i-r/opt/svndata
}
Original posted Address: http://www.linuxidc.com/Linux/2008-02/11181p2.htm
Here's my supplementary.
To install, import, and check out files:
Install Tortoisesvn-1.4.7.11792-win32-svn-1.4.6.msi on the client;
1, import file:
Create a folder Svntest, right-click the folder, select TortoiseSVN-> Version Gallery Browser-> enter the URL address because the listening port is 9999, so the URL address is as follows:
Svn://192.168.1.100:9999/repos1
Click OK, enter username and password (test 123456) login; Right-click in the Repository browser to create folders, add folders, import, export;
2, check out the file:
Right-click Svntest, select SVN Checkout, enter the version library URL, such as
Svn://192.168.1.100:9999/repos1
Enter a username and password (test 123456) to check out the file