How to configure svn and svn in Linux

Source: Internet
Author: User

Next, I will introduce two methods for setting up svn and svn service configuration in Linux. One is to compile the source code to install svn, and the other is to install the svn service in the yum command mode, next we will introduce them separately.

Install svn in compilation Mode

1. Use the source file for compilation and installation. There are two source files:

Subversion-1.6.1.tar.gz (subversion source file)
Subversion-deps-1.6.1.tar.gz (subversion dependency files)

Note that the file versions must be consistent; otherwise, various strange problems may occur.

2. Upload the above two files to the server and decompress them. Decompress the command:
 
Tar xfvz subversion-1.6.1.tar.gz

Tar xfvz subversion-deps-1.6.1.tar.gz

3. decompress the package and generate the subversion-1.6.1 subdirectory. After the two packages are decompressed, they will be automatically placed in this directory without manual modification.


4. Go to the unzip subdirectory: cd subversion-1.6.1

5. Execute./configure -- prefix =/usr/local/svn

./Configure: error: We require OpenSSL; try-with-openssl

Configure failed for serf.

This is because openssl related packages are not installed.

Openssl Official Website: http://www.openssl.org/

Openssl installation in linux:

Wget http://www.openssl.org/source/openssl-1.0.0g.tar.gz


Tar xvzf openssl-1.0.0g.tar.gz
Cd openssl-1.0.0g

Then:
./Config -- prefix =/usr/local/ssl shared zlib-dynamic enable-camellia

Then execute:
Make depend

Make

Make test

Make install

Edit/etc/ld. so. conf, add to paths/usr/local/ssl/lib (you can directly go to/etc/ld. so. conf. d

File

Create a. conf file under the folder and copy/usr/local/ssl/lib to it. You can also create a. conf file in the existing. conf file.

Add the path/usr/local/ssl/lib. Anyway, ld. so. conf contains all. conf files in this folder)

After installation, an ssl directory is generated under/usr/local, environment variables are set, and added to the PATH of/etc/profile.

Add the following content

 

Capacity: PATH =/usr/local/ssl/bin:/sbin/: $ PATH:/usr/sbin


Export PATH

 

6. Go to subversion-1.6.1 and then execute./configure -- prefix =/opt/subversion to configure and specify

Install

 

Directory. Note that there are two minus signs before the prefix. The BDB package is not included by default, so the FSFS mode is used by default. To use the BDB Model

Type.

 

We recommend that you use the FSFS mode.

 

After configure is completed, the following error may occur:

 

You don't seem to have Berkeley DB version 4.0.14 or newer installed and linked

APR-UTIL.

 

We have created Makefiles which will build without the Berkeley DB back-end; your

Repositories

Will useFSFS as the default back-end. You can find the latest version of Berkeley DB

Here:

 

Http://www.oracle.com/technology/software/products/berkeley-db/index.html

 

You do not seem to have the Berkeley DB version 4.0.14 or the latest version installed and linked to April-util. We have created

The Makefile file will create

 

Without the Berkeley DB backend, your version library uses the FSFS format as the default backend. You can find the latest version

The location of the Berkeley DB.

 

This prompt can be skipped because no BDB storage is used.

 

7. Execute make compilation.


8. Execute make install to install.

 

 

9. Add environment variables:


Vi/etc/profile

 

Add at the end of the file:

SVNPATH = $ PATH:/usr/local/svn/bin

Export SVNPATH

10. Run the following command to test whether SVN is successfully installed:

Svnserve -- version

If the version information is displayed, the installation is successful. (If svnserve is not installed, install apt-get install first.

Subversion)

 

 

The preceding steps deploy the svn server on linux. The following describes the svn Server Configuration:

 

 

1. Create a version library directory. The created version library directory and installation directory are not in the same directory (you can create multiple directories.

Required

 

Reconfigure. Note the differences between the installation directory and the version library directory. The following describes the version library directory)


Mkdir-p/opt/svndata/repos

 

2. Create the svn version Library (corresponding to the above directory)


Svnadmin create/opt/svndata/repos

After executing this command, svn automatically adds the required configuration file under the repos directory.

 

3. Modify the version library configuration file


Vi/opt/svndata/repos/conf/svnserve. conf

 

The parameter functions are described in the remarks in the configuration file. The configuration is as follows:


[General]

Anon-access = none # Make unauthorized users inaccessible

Auth-access = write # grant the authorized user the write permission

Password-db =/opt/svndata/repos/conf/passwd # specify the password file path

Authz-db =/opt/svndata/repos/conf/authz # access control file

Realm =/opt/svndata/repos # authenticate the namespace. The subversion is displayed in the authentication prompt and

 

The key word used as the credential cache.

Other default configurations are used. Each statement must be written in the top level, and no space is left. Otherwise, an error occurs.

Command Description: This is the format of the svn configuration file. Please follow the above format.

 

4. Configure the user: passwd file


Enter the following content:
[Users]
<User 1> = <password 1> admin = admin
<User 2> = <password 2> username2 = password2

You can add multiple user name and password pairs.

5. Configure permissions: authz files

Command Introduction: This configuration file adopts the "Path-based authorization" policy, which specifies the path in brackets. The following lists the permissions granted to users.

Permission. Including read-only r and read/write rw. Users not listed are not allowed to access. You can also group users. For details, refer to the svn manual,

The following is a simple example:


<! -- [If! SupportLineBreakNewLine] --> 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/opt/svndata. In this way,/is the table

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.

, Null indicates that you do not have any permissions.

 

 

Note: You must be careful when configuring auth, passwd, and svnserve. conf. Otherwise, authentication will fail during client access, if not

Baidu and Google have a lot of information for reference.

 

 

After the configuration is complete, start svn: the default svn port is 3690.

 

1. Run the following command: svnserve-d-r version library path: listen-host 192.168.1.178.

 

For example: svnserve-d-r/opt/svndata -- listen-host 192.168.1.178

 

 

Problems encountered during startup:

When svnserve is started, cannot bind server socket: address already in use appears.

 

Solution:

Method 1: Find the svnserve id to kill the process

Netstat-ntlp

Kill-9 id


Method 2: specify a port number again (default port 3690)

Svnserve-d -- listen-port 3691-r/opt/svndata/repos

 

 

2. Check whether the process is successfully started: (check whether the svnserve process exists)

 

Ps-ef | grep svnserve


3. Finally, install the client

Install the svn service in yum command mode

 

1. First, check whether you have installed svn. If you have already installed svn, you don't have to worry about it.
Rpm-qa | grep subversion

2. If not, install svn.
Yum-y install subversion

3. Test whether svn is successfully installed.
Svn -- version

Svn service configuration:
1. Create a repository first
Svnadmin create/var/www/test_repo

2. Configure directory attributes and user permissions. If the repository is created successfully, you will see svnserve. conf in the test_repo/conf folder.

, Passwd and authz files
(1) set repository permissions, vi svnserve. conf

Anon-access = none
Auth-access = write
Password-db = passwd
Authz-db = authz


(2) configure the user and password, vi passwd

[Users]
Mckee = phpddt.com


(3) Configure user operation permissions vi authz

[Test_repo:/]
Mckee = rw


3. Now you can start the svn service.
Svnserve-d-r/var/www -- listen-host 42.121.145.230
You can check whether the service is successfully started:
Netstat-tunlp | grep svn

This is so simple that the svn service has been set up, and you can checkout a working copy, because I actually write it in windows

So integrated GUI tools are used.

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.