SVN version control system Setup (combined with HTTP service)

Source: Internet
Author: User
Tags version control system

SVN version Control Server Setup

SVN (Subversion) is an open source control system that manages and stores the source code of the development, based on the C/S mode. Services can be provided separately or in conjunction with HTTP services.

Operating mode Run port Access method
SVN standalone Service 3690 svn://
HTTP binding Service 80 /HTTP

Start building SVN services below

1. Environmental preparedness

(1) Install SVN and Apache services, where MOD_DAV_SVN is used to connect SVN and Apache.

Yum Install Subversion httpd mod_dav_svn

(2) Check whether the port is registered

Cat grep Svn–color

(3) Create and store repository

mkdir /web

(4) Creating a Web project instance

Svnadmin create/web//web/www.demonxian2.cn

(5) View SVN version related files

You can see that some files are generated in the directory created through Svnadmin.

Directory Role
Dav Provides directories used by Apache and MOD_DAV_SVN, which are created manually
Db Storing version-controlled database files
Hooks Storing Hook script files
Locks A directory that stores SVN monitoring lock data to track clients accessing the vault
Conf Store profiles (user access to accounts and permissions, etc.)
Format file Holds an integer representing the version of the current vault configuration

The following is the file contents of the Conf directory

File Role
Authz Configuration of authentication Permissions
passwd Configuration of user passwords
Svnserve Server-related configuration
2. Modify the configuration

(1) Modify the Svnserve service configuration

Vim/web/www.demonxian3.cn/conf/svnserve.conf

The following fields are commented by default and need to be removed

anao-access = Read #表示匿名用户可读 value is: Read Write none

auth-access = Write #表示认证用户可写, same as value

Password-db = passwd #表示指定密码库的配置文件

Authz-db = Authz #表示指定认证权限配置文件

Realm = www.demonxian3.cn #登录提示信息

Note that the above field must be shelf, that is, the front cannot be left blank, otherwise it will error

(2) Modify passwd user password configuration

vim/web/www.demonxian3.cn/conf/passwd

Add three users with a password of 123456

(3) Modify Authz permissions Configuration

Vim/web/www.demonxian3.cn/conf/authz

A CG group is defined in the groups domain, and the team members have Demon1,dmeon2

In the root domain (own write) in the definition of permissions, CG group only Read permissions, Demon3 can be written and readable, no other people have permission

3. Start the service
svnserve-d-r/web/    #-d running the web as the root user is the software repository that you create yourself with the daemon run-R

View ports

SVN commands that are commonly used

Import Upload Code
Checkout Download code
Update Update code
Status View status
Diff Differential detection
Log Historical records
List Show Table of Contents
Cat View Content
Resolve Resolve Conflicts
Switch Switch repository
Revert Recovery
Add Increase
Delete Delete
Copy Copy
Move Move

For more information, see http://blog.csdn.net/ithomer/article/details/6187464

4.SVN service easy to use test
mkdir local   #创建本地开发目录 Touch local/1. html local/2. html      file ://web/www.demonxian3.cn/-M "first edit"  #导入 svn checkout svn://  192.168.1.112/www.demonxian3.cn/download     #取出代码

1. The replacement code will pop up the authentication, the default is the root user, enter the user name and password.

2. Note that the logged-on user needs to have read access or not be able to download

3. After the code is removed, it will be generated in the current download directory, in which the relevant code development can be

The following simulates the development of the code after the update.

Touch download/3. htmlecho23. HTML                                # Add new files synchronously in svn svn commit–m "second edit"        #提交代码, which also requires user authentication. 

If the entered account and password do not have permission to write, the write fails

Below to build the HTTP + SVN service

1. See if Apache has introduced the SVN module
Vim/etc/httpd/conf.d/subversion.conf

If you see two fields, it means a successful introduction

LoadModule Dav_svn_module modules/mod_dav_svn.so

LoadModule Authz_svn_module modules/mod_authz_svn.so

Physical path of two modules

/etc/httpd/modules/mod_authz_svn.so

/etc/httpd/modules/mod_dav_svn.so

2. Editing the Subversion module configuration file

Vim/etc/httpd/conf.d/subversion.conf #在参照末尾location标签添加下面的内容

<Location/web>

DAV SVN

Svnparentpath/web #指定svn根目录

AuthType Basic #Basic认证方式

AuthName "www.demonx.cn" #认证显示提示信息

AUTHUSERFILE/WEB/SVN/PASSWD #用户密码文件

Authzsvnaccessfile/web/svn/authz #用户配置文件

Require Vaild-user #要求用户认证不许匿名

</Location>

3. Create Apache access to SVN-related configuration files

mkdir /WEB/SVN

Create a user password file and configure a password

htpasswd–c/web/svn/passwd dem1    #参数-/web/svn/passwd  dem2

Create a rights profile

Vim/web/svn/authz #添加下面的内容

[Groups]

all = Dem1,dem2

[/]

DEM1 = RW

[www.demonxian3.cn:/]

@all = RW

[www.demonxian2.cn:/]

DEM1 = RW

DEM2 = R

Service httpd Restart

Then using browser access, you will find that user authentication is required

Use the Little Turtle tool below to access SVN

Use the small turtle to upload and download the code, although this is what developers do, but as an OPS staff should also know a little. Here is the download address of the Little turtle

Http://tortoisesvn.net/downloads.html

After the download, you will be right-click to generate SVN related plugins.

Configure the relevant options, using the SVN service access configuration as follows

Note that the URL can not be the root directory/web also filled up.

Enter the user name and password, do not save

If you use the HTTPD service to access SVN version Manager, configure the following

Successfully put down the code, and submit the same right click on commit, if sometimes the failure to turn the following

It is possible that your directory permissions are not enough, modify it as my: Chmod-r 777/web

Reprint Please specify source: http://www.cnblogs.com/demonxian3/p/6910206.html

SVN version control system Setup (combined with HTTP service)

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.