SVN server Building, it is not the most comprehensive but the most detailed and understandable ~

Source: Internet
Author: User
Tags svn client

Just received this task, my face is written two big ignorant force two words! Can be said to be the basis of 0, then my proficiency in the SVN client may be less than the company's civil service, let alone the server! 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0021.gif "alt=" J_0021.gif "/>

Task hand, dead carry on to the end, this is my character ~ My combat environment can be said to be very hard, no technical documentation, and on my one operation!

Just like a headless fly on the Internet, turn the data upside down 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0004.gif "alt=" J_0004.gif "/> Only gradually has the logic and the thought. But also wasted a lot of trouble just to fix! Those days on the Internet every day to see the data after work, the eyes are red!

Research for a long time, finally succeeded, because the information on the Internet uneven, messy no chapter landlord suffered from its suffering, so decided to write down with June to avoid its suffering.


First, understand the following SVN introduction and basic principles:

Introduction:   

    Subversion (SVN) is a version management software that has risen in recent years and is the successor to CVS, and most open source software uses SVN as the code version management software. Subversion supports linux and Windows

SVN server is commonly used in two ways: standalone server SVN://IP address, and Apache/HTTP/IP address (can also be based on Nginx and other services)
The SVN client is TORTOISESVN


Principle:

Create a source code repository on a single server where you can store many different project source programs. These source programs are managed uniformly by the source code library administrator. Each user before using the source code library, the first to download the project files in the source code library to local, and then the developer can be modified locally, and then submitted with the SVN command. and different departments can also upload some information to provide the Department's personnel upload and download, similar to the FTP, network and other functions.


Second, the way to install SVN

The installation and configuration of the standalone SVN server is introduced first, and the Apache Access SVN is based on a standalone server.

There are two common ways to install SVN: Yum installation, source installation. Personal recommendations If you want to use Yum to install, you do not have to consider a variety of dependencies and variables, and source installation here is not a lot of tutorials on the web!

Yum Installation:

1.yum install-y Subversion

2. After installation, look under: rpm-ql Subversion, then pull to the top, representing the successful installation

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/82/F7/wKioL1dni7-gTrFXAAA6_y9Ta_s924.png "title=". PNG "alt=" Wkiol1dni7-gtrfxaaa6_y9ta_s924.png "/>

3. Configure SVN

Create the Repository directory first: mkdir-p/opt/svn/"Directory can be created as specified".

Create the repository you want: Svnadmin create/opt/svn/zt, create a few files that will be generated in the ZT repository 650) this.width=650; src= http://s2.51cto.com/wyfs02/ M02/82/f7/wkiol1dnji-wc4t7aaazb5mckzw694.png "title=" 3149.png "alt=" Wkiol1dnji-wc4t7aaazb5mckzw694.png "/>

Entering into Conf will have three configuration files added as follows:

Authz: Privilege profile

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/82/F7/wKioL1dnkE_iVm7oAAAS4115-Xc499.png "title=" 3.png " alt= "Wkiol1dnke_ivm7oaaas4115-xc499.png"/>

passwd: Password file

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/82/F8/wKiom1dnkF2C88AVAAAUEgirrqU642.png "title=" 56.png "alt=" Wkiom1dnkf2c88avaaauegirrqu642.png "/>


SVNSERVE.CONF: Repository configuration file

go to the Repository configuration file, Open a few notes below, note: Get the head written:

Anon-access = Read #匿名用户可读

auth-access = Write #授权用户可写

Password-db = passwd #使用哪个文件作为账号文件

Authz-db = Authz #使用哪个文件作为权限文件

Realm =/opt/svn/zt # certified space name, repository directory


4. After the appeal configuration is complete, start the repository: svnserve-d-r/opt/svn/zt

Execute NETSTAT-ANPT |grep svn ———— > Kill PID number for successful execution if the reported error occurs

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/82/F8/wKiom1dnkmOgKhR0AAARPJBNvAc581.png "title=" 5.png " alt= "Wkiom1dnkmogkhr0aaarpjbnvac581.png"/>

5. The client can then perform the following actions, if

New Folder Right-click Checkout, as shown in:

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/82/F7/wKioL1dnk3GjvWm9AABjT_G1zVQ892.jpg "style=" float: none; "title=" 2830793840796242418.jpg "alt=" Wkiol1dnk3gjvwm9aabjt_g1zvq892.jpg "/>

SVN server ip/Repository

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/82/F7/wKioL1dnlDaj7w0TAAC4VQIoWTo592.png "title="---. PNG "alt=" Wkiol1dnldaj7w0taac4vqiowto592.png "/>

The account password specified in the passwd

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M02/82/F7/wKioL1dnk3KyTO9MAABmhweOc9U427.jpg "style=" float: none; "title=" 2577747836733366402.jpg "alt=" Wkiol1dnk3kyto9maabmhweoc9u427.jpg "/>



(2.) If you want to run more than one repository on a standalone SVN server, you need to specify a port for it.

Svnserve--listen-port 3691-d-r/opt/svn/zt/

Svnserve--listen-port 3692-d-r/opt/svn/repos/

Svnserve-d-r/opt/svn/

Restart each repository and start the entire repository directory


Third, Apache-based access to SVN installation and configuration

This is built on the success of the independent SVN server, first ps-ef |grep httpd query httpd Whether it belongs to Apache

Conversely, yum-y install MOD_DAV_SVN httpd is required.


    1. ls/etc/httpd/modules/| grep SVN:SVN Validation Module

Mod_authz_svn.so mod_dav_svn.so


2.apache Related configuration: vim/etc/httpd/conf.d/subversion.conf

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/82/F7/wKioL1dnmjPzodAJAABfLekx5L0328.png "title=" QQ picture 20160620152329.png "alt=" Wkiol1dnmjpzodajaabflekx5l0328.png "/>

Svnpath to define a single library

Svnparentpath Defining multiple libraries

Note: Apache configures the location in the repository directory to create passwords and permissions profiles, and the SVN server is created in the repository, creating a similar approach.


3. Create an Access user (the first creation needs to add-C, which represents the first new user)

HTPASSWD-C/OPT/SVN/PASSWD ABC

Password:

Enter the password again:

ABC User created successfully


Delete User: htpasswd-d passwd ABC


4. Granting Permission Issues

Chown-r apache.apache/opt/svn/Version Library

Chmod-r 777/opt/svn/


Permissions issues for 5.authz

[Groups] #在这里设置组, = followed by the user, split

admin = admin,admin1,admin2

Users = User,user1,user2


[zt:/]

#这里是版本库zt, which indicates that there is some kind of permission on this library, @admin represents a group, does not add @ for a single user

#注意更改的配置需要顶到头不可以有空格否则会报错

@admin = RW

user = R


[Zt:/123]

#这里指的是对zt版本库下的123目录有什么权限

@users = RW

Just restart httpd after the creation is complete service httpd restart

And then follow the second step to perform the client's operation just need to change the path to it: HTTP://IP address/svn/zt


#注意

The original normal operation of the SVN server suddenly collapsed, it is strange why this, check the whole day, only to find that the permissions file conflicts will be as the entire server collapsed, and then re-adjust the permissions under normal.

and the repository path in the Authz can not have garbled or not


Perhaps follow this article finished the whole will be reported some of the mistakes, but believe me, this article has given you complete ideas and configuration steps and you just need to be based on the wrong information targeted to the Internet to find answers, the problem can be the edge of the solution, and you can take this opportunity to learn more about the SVN hierarchy structure.

Feel useful on the forwarding point like, a lot of comments together exchange

This article is from the "11422312" blog, please be sure to keep this source http://11432312.blog.51cto.com/11422312/1791074

SVN server Building, it is not the most comprehensive but the most detailed and understandable ~

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.