Go installation, configuration, and boot-up of SVN under Linux (centOS6.5)

Source: Internet
Author: User

1. Check if it is installed

Rpm-qa Subversion

If you want to uninstall the old version:

Yum Remove Subversion

2. Installation

Yum Install Subversionps:yum install httpd httpd-devel Subversion mod_dav_svn Mod_auth_mysql (this is a module installed with Apache, I haven't done it yet, Do it again, you can only install subversion, more loaded also does not matter) #确认是否已安装svn模块
[Email protected] ~]# Cd/etc/httpd/modules;ls|grep SVN
Mod_authz_svn.so
Mod_dav_svn.so
If you do not need to install MOD_DAV_SVN
#yum-y Install MOD_DAV_SVN (i installed it)

3. Check if the installation is successful

Svnserve--version

If successful, the version number is output

4. Create a warehouse directory
For example:

Mkdir/var/www/svn/repos (! First-level creation! ) 5. Create a project svnadmin Create/var/www/svn/repos 6. Check whether the creation was successful
Cd/var/www/svn/repos
ll if successful, the game directory will be more than a few folders Conf,db,format,hooks,locks, README.txt and other files, stating that an SVN library was established.

7. Configure code base

Go to the folder created above conf , configure

Cd/var/www/svn/repos/conf

7.1 User password passwd configuration

Vim passwd

the contents of the passwd file are as follows:

# # # This file is a example password file for Svnserve.

# # # Its format was similar to that of svnserve.conf. As shown in the

# # # example below it contains one section labelled [Users].

# # # The name and password for each user follow, one account per line.

[Users]

# Harry = Harryssecret

# sally = Sallyssecret

Test = 123456789 # # Add user's username and password

7.2 Permissions Control authz configuration

VI Authz

The purpose is to set which users can access which directories, the contents of the Authz file are as follows:

# # # This file isAn example Authorization file forsvnserve.### its format isidentical to, MOD_AUTHZ_SVN authorization### files.### as shown below each section defines authorizations  forThe path and### (optional) repository specified by the section name.### the authorizations follow. An authorization line can refer to:###-a single user,###-a group of users definedincha special [groups] section,###-An alias definedincha special [aliases] section,###-All authenticated Users,usingThe'$authenticated'token,###-Only anonymous users,usingThe'$anonymous'token,###-Anyone,usingThe'*'wildcard.###### A match can is inverted by prefixing the rule with'~'. Rules can### Grant Read ('R') Access, Read-write ('RW') access, or no access### ("'). [aliases]# Joe=/c=xz/st=dessert/l=snake City/o=snake oil, Ltd./ou=research institute/cn=Joe average[groups]# harry_and_sally=harry,sally# Harry_sally_and_joe= harry,sally,&joe# [/foo/bar]# Harry=rw#&joe =r#* =# [repository:/baz/fuz]# @harry_and_sally=rw#* =r[/]test=RW Settings [/] represents all resources under the root directory

7.3 Service svnserve.conf Configuration

VI svnserve.conf

the contents of the svnserve.conf file are as follows:

[General] #匿名访问的权限, can be Read,write,none, default is Readanon-access=none# give authorized users Write permission auth-access= write# Path to the password database password-db=passwd# access control file Authz-db=authz# authentication namespace, Subversion is displayed in the authentication prompt, and as a keyword in the credential cache Realm=/var/www/svn/repos

Firewall Open SVN port default is 3690 port

Start SVN Service

Svnserve-d-r/opt/svn/repositories

8. View the SVN Process

Ps-ef|grep svn|grep-v grep

Return

Root 20850 1 0 Jul24? 00:00:00 svnserve-d-r/opt/svn/repositories

9.Check the SVN Monitor Port

Netstat-ln |grep 3690

Stop the SVN fromstarting.

Killall Svnserve # Stop

svnserve-d-r/opt/svn/repositories # Boot

11, installed SVN server, the default is not boot from the boot, each boot itself will be very troublesome, we can set it to boot
First: Write a startup script svn_startup.sh, which I put in/root/svn_startup.sh
#!/bin/bash
/usr/bin/svnserve-d-r/home/svn/Here The Svnserve path is safe, it is best to write the absolute path, because the environment variable may not be loaded when it is started.
How do you find the absolute path?
Which Svnserve

There may also be a problem, if you build and write under Windows Script, get Linux, with VI or VIM modified may be unable to execute, this is a file format problem

VI svn_startup.sh
Input: Set FF Enter
If the displayed result is not Fileformat=unix
Re-enter
Set Ff=unix
It's OK.

Then modify the Execute permissions for the script

chmod ug+x svn_startup.sh

or everything.

chmod 777 svn_startup.sh

Last: Join Auto run

Vi/etc/rc.d/rc.local
Add the path to the script at the end, such as:
/root/svn_startup.sh

Now, you can reboot and try again. Do not know how to confirm success? I lost you.

Ps-ef|grep Svnserve 12. Install SVN client

Currently the most popular svn Client is non- TortoiseSVN

Download installation

Client Connection Address:svn:// The IP address of the public network or intranet , sometimes need to add port number

Username / password : test/123456789 # # to match the username and password you set previously

Attention:

The default port is 3690, if the port is occupied, or if you need to modify the port, use the following statement

svnserve-d-r/opt/svn/repositories--listen-port 3691

Go installation, configuration, and boot-up of SVN under Linux (centOS6.5)

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.