Install and configure the independent SVN server Subversion server under CentOS6.X
Subversion (SVN for short) is an open-source version control system. It adopts a branch management system compared with RCS and CVS. Its design goal is to replace CVS. Many version control *** services on the Internet have been transferred from CVS to Subversion. Svn servers can run in two ways: independent servers and apache. Next I will install the independent SVN
First, clear the yum cache. yum clean all
[1] install subversion
Yum install subversion-devel
Then select y (yes) to confirm installation. Of course, you can add the-y parameter during yum install.
Run the svnserve -- version command. If the entered information is already entered, the installation is successful.
2. svn configuration multiple directories can be created for creating the svn version Library:
Mkdir-p/opt/svndata/repos1
Mkdir-p/opt/svndata/repos2
Create the svn version library svnadmin create/opt/svndata/repos1
Svnadmin create/opt/svndata/repos2
Modify svn version library configuration file version Library 1:
Vi/opt/svndata/repos1/conf/svnserve. conf
Modify the content:
[General]
Anon-access = none
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
Modify the content:
[General]
Anon-access = none
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 exactly the same as those of version 1. If more version libraries are available, follow these steps.
Configure the svn user vi/opt/svn/conf/pwd. conf that can be accessed
To simplify the configuration, two version libraries share one user configuration file. If necessary, they can also be separated.
Note: modifications to user configuration files take effect immediately without the need to restart svn.
The file format is as follows:
[Users]
<User 1 >=< password 1>
<User 2 >=< password 2>
[Users] is required. The following lists the users who want to access svn. each user has a row. Example:
[Users]
Alan = password
King = hello
Configure svn User Access Permissions vi/opt/svn/conf/authz. conf
To simplify the configuration, the three version libraries share one permission configuration file/opt/svn/conf/pwd. conf. If necessary, they can also be separated. File.
Note:
* The user name displayed in the permission configuration file must be defined in the user configuration file.
* Changes to the permission configuration file take effect immediately without restarting svn.
User Group format:
[Groups]
<User group name >=< user 1>, <user 2>
One user group can contain one or more users separated by commas.
Version library directory format:
[<Version library>:/project/directory]
@ <User group name >=< permission>
<User name >=< permission>
The box number can be written in multiple ways:
/, Indicating the root directory and the following. The root directory is specified when svnserve is started. We specify it as/opt/svndata. In this way,/sets permissions for all version libraries.
Repos1:/, indicating to set permissions for Version 1
Repos2:/abc, indicating to set permissions for the abc Project in version library 2
Repos2:/abc/aaa, indicating to set permissions for the aaa directory of the abc Project in version library 2
The permission subject can be a user group, user, or *. The user group is preceded by @, * indicating all users. The permission can be w, r, wr, or null. If it is null, no permission is granted.
Example:
[Groups]
Admin = alan
[/]
@ Admin = rw
[Repos1:/abc/aaa]
King = rw
[Repos2:/pass]
King =
Svn configuration is complete, delete useless 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 and create useradd svn
Passwd svn
Set the user svn password as prompted
Allow user svn to access the version library chown-R svn: svn/opt/svndata
Chown-R svn: svn/opt/data
Start svnsu-svn-c "svnserve-d -- listen-port 9999-r/opt/svndata"
Where:
Su-svn indicates to start svn as user svn
-D Indicates running in daemon mode (running in the background)
-Listen-port 9999 indicates port 9999, which can be replaced with the required port. Note that the root permission is required to use ports lower than 1024.
-R/opt/svndata specifies that the root directory is/opt/svndata
Check:
Ps-ef | grep svnserve
If the following information is displayed, the instance is successfully started:
Svn 6941 1 0? 00:00:00 svnserve-d-listen-port 9999-r/opt/svndata
Add automatic start upon startup
Echo "svnserve-d -- listen-port 9999-r/opt/svndata">/etc/rc. local