[Reprint + Finishing]centos 6.3 on the configuration SVN server

Source: Internet
Author: User
Tags collabnet

1, the article Source Blog garden: http://www.cnblogs.com/zhoulf/archive/2013/02/02/2889949.html

Zhoulf 2013-02-02 Original Installation Instructions

System Environment: CentOS-6.3
Installation method: Yum Install (source installation is prone to version compatibility issues)
Install software: The system automatically downloads SVN software

Check for installed versions

#检查是否安装了低版本的SVN
[Email protected]/]# Rpm-qa Subversion

#卸载旧版本SVN
[email protected] modules]# Yum Remove subversion

Install SVN

[email protected] modules]# Yum install httpd httpd-devel Subversion mod_dav_svn mod_auth_mysql

Confirm that the SVN module is installed

[Email protected]/]# Cd/etc/httpd/modules
[[email protected] modules]# ls | grep SVN
Mod_authz_svn.so
Mod_dav_svn.so

Verifying the installation

Verify that the SVN version information is installed
[Email protected] modules]# Svnserve--version

Svnserve, Version 1.6.11 (r934486)
Compiled in June 23 2012,00:44:03

Copyright (C) 2000-2009 CollabNet.
Subversion is an open source software, see the http://subversion.tigris.org/site.
This product contains software developed by CollabNet (http://www.Collab.Net/).

The following repository back-end (FS) modules are available:

* Fs_base: The module can only operate the BDB repository.
* FS_FS: The module works with a text file (FSFS) repository.

Cyrus SASL certification is available.

Code base Creation

SVN repository is also required after the installation
[Email protected] modules]# mkdir-p/opt/svn/repositories
[Email protected] modules]# svnadmin create/opt/svn/repositories
After executing the above command, the repositories library is automatically established, and the View/opt/svn/repositories folder discovery contains Conf, db,format,hooks, locks, README.txt and other files, stating that an SVN repository has been established.

Configuring the Code base

Go to the folder created above conf, configure
[Email protected] modules]# cd/opt/svn/repositories/conf

User Password passwd configuration

[Email protected] password]# cd/opt/svn/repositories/conf
[Email protected] conf]# VI + passwd
Modify passwd to the following:

[Users]
# Harry = Harryssecret
# sally = Sallyssecret
zhoulf=123456 Permissions Control Authz Configuration

[Email protected] conf]# VI + Authz
The goal is to set which users can access which directories, append the following to the Authz file:

#设置 [/] represents all resources in the root directory
[/]
ZHOULF=RW Service svnserve.conf Configuration

[Email protected] conf]# VI + svnserve.conf

Append the following content:

[General]
#匿名访问的权限, can be read,write,none, default is read
Anon-access=none
#使授权用户有写权限
Auth-access=write
#密码数据库的路径
password-db=passwd
#访问控制文件
Authz-db=authz
#认证命名空间, Subversion is displayed in the authentication prompt and is used as a keyword in the credential cache
Realm=/opt/svn/repositories Configuring Firewall ports

[Email protected] conf]# Vi/etc/sysconfig/iptables
Add the following content:
-A input-m state--state new-m tcp-p TCP--dport 3690-j ACCEPT
Restart firewall after saving
[Email protected] conf]# service iptables restart

Start SVN

Svnserve-d-r/opt/svn/repositories

View SVN process

[Email protected] conf]# Ps-ef|grep svn|grep-v grep
Root 12538 1 0 14:40? 00:00:00-d-r/opt/svn/repositories

Detecting SVN ports

[Email protected] conf]# Netstat-ln |grep 3690
TCP 0 0 0.0.0.0:3690 0.0.0.0:* LISTEN

Stop restarting SVN

[[email protected] password]# killall svnserve//Stop
[[email protected] password]# svnserve-d-r/opt/svn/repositories//start

Test

The SVN service is started and the connection is tested using the client.
Client Connection Address: svn://192.168.15.231
Username/password: zhoulf/123456
Tests the creation of folders and other operations.

But: I've had a problem that has been reported

Can ' t connect to host ' 192.168.1.121 ': The connection attempt failed because the connecting party did not reply correctly after a period of time or the connected host did not respond.

Workaround: 1, I've been looking for a long time to find a centos firewall problem

Service Iptables Stop

Close the firewall, you can move out of the normal migration files.

2, this is really a day dog, I follow the above Bo Master's tutorial, has been error, the firewall is also set up, and later I found that is the INSERT statement:-a input-m State--state new-m tcp-p TCP--dport 3690-j the location of the ACCEPT put asked Problem.

Now my virtual machine/etc/sysconfig/iptables file is open like this

As long as the-A input-m state--state new-m tcp-p TCP--dport 3690-j ACCEPT to--reject that is the commit above the two lines will not be taken, I put in the space, will not error will be frequently updated.

Automatically start SVN service

Two, we can already configure their own library, but each boot to manually start the SVN help desk cumbersome, we set up the Linux boot service.

Solution 1: Write the start command to Svnserve-d-r/opt/svn/repositories on the last line of/etc/rc.d/rc.local

In fact, the general meaning of the English in Rc.local is that the script will be executed when the other initialization scripts are executed. This is easy to understand. You can execute shell commands directly and, of course, execute other shell scripts.

Format is program name program path

For example a.sh/home/a.sh adds the command to the last line of rc.local

2: Your own handwriting startup script (actually put svnserve-d-r/opt/svn/repositories in the script), and set as a service, boot start, this is a bit verbose: I have tried to succeed:

Link One: http://blog.sina.com.cn/s/blog_5f54f0be0101b3bs.html

Link two: http://blog.csdn.net/jiedushi/article/details/6767445/this a little bit of a problem, the reader himself groping

To-do Configuring multiple libraries

Third, workaround 1, create two SVN directories in the same directory, and finally start the service with the parent directory as the standard

For details, see: http://blog.sina.com.cn/s/blog_8882a6260101a4ox.html

Workaround 2,http://mw-fang.iteye.com/blog/1787766 Method 2 This I tried, there is a problem, if a friend test success trouble please tell me

Summary: In fact, CentOS can only start one SVN service at a time (I do not feel properly, the port settings can be different to open multiple??? )

The first method above can indeed create multiple libraries, but it is actually the root of two libraries as the total repository of SVN ·

and build a library, take it out and create a new two folders. The effect of the classification management is exactly the same ...

Let's just forget this!

[Reprint + Finishing]centos 6.3 on the configuration SVN server

Related Article

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.