Install the Subversion service in CentOS 6.6
I. Introduction
Subversion is short for svn server, used to host code, similar to git
1) CentOS 6.6
2) Subversion
Ii. Installation
Yum-y install subversion
Iii. Configuration
$ Vi/etc/init. d/svnserve
#! /Bin/bash
#
# Svnserve Startup script for the Subversion svnserve daemon
#
# Chkconfig:-85 15
# Description: The svnserve daemon allows access to Subversion repositories \
# Using the svn network protocol.
# Processname: svnserve
# Config:/etc/sysconfig/svnserve
# Pidfile:/var/run/svnserve. pid
#
### BEGIN INIT INFO
# Provides: svnserve
# Required-Start: $ local_fs $ remote_fs $ network
# Required-Stop: $ local_fs $ remote_fs $ network
# Short-Description: start and stop the svnserve daemon
# Description: The svnserve daemon allows access to Subversion
# Repositories using the svn network protocol.
### END INIT INFO
# Source function library.
./Etc/rc. d/init. d/functions
If [-f/etc/sysconfig/svnserve]; then
./Etc/sysconfig/svnserve
Fi
Exec =/usr/bin/svnserve
Prog = svnserve
Pidfile =$ {PIDFILE-/var/run/svnserve. pid}
Lockfile =$ {LOCKFILE-/var/lock/subsys/svnserve}
Directory =$ {DIRECTORY-/var/subversion}
Args = "-- daemon -- pid-file =$ {pidfile} -- root =$ {directory} $ OPTIONS"
[-E/etc/sysconfig/$ prog] &./etc/sysconfig/$ prog
Lockfile =/var/lock/subsys/$ prog
Start (){
[-X $ exec] | exit 5
[-F $ config] | exit 6
Echo-n $ "Starting $ prog :"
Daemon -- pidfile =$ {pidfile} $ exec $ args
Retval =$?
Echo
If [$ retval-eq 0]; then
Touch $ lockfile | retval = 4
Fi
Return $ retval
}
Stop (){
Echo-n $ "Stopping $ prog :"
Killproc-p $ {pidfile} $ prog
Retval =$?
Echo
[$ Retval-eq 0] & rm-f $ lockfile
Return $ retval
}
Restart (){
Stop
Start
}
Reload (){
Restart
}
Force_reload (){
Restart
}
Rh_status (){
# Run checks to determine if the service is running or use generic status
Status-p $ {pidfile} $ prog
}
Rh_status_q (){
Rh_status>/dev/null 2> & 1
}
Case "$1" in
Start)
Rh_status_q & exit 0
$1
;;
Stop)
Rh_status_q | exit 0
$1
;;
Restart)
$1
;;
Reload)
Rh_status_q | exit 7
$1
;;
Force-reload)
Force_reload
;;
Status)
Rh_status
;;
Condrestart | try-restart)
Rh_status_q | exit 0
Restart
;;
*)
Echo $ "Usage: $0 {start | stop | status | restart | condrestart | try-restart | reload | force-reload }"
Exit 2
Esac
Exit $?
$ Mkdir-p/var/subversion
$ Cd/var/subversion/
$ Svnadmin create repos
$ Cd repos
$ Vi conf/svnserve. conf
[General]
Anon-access = none
Auth-access = write
Password-db = passwd
Authz-db = authz
# Realm =/var/subversion/repos
[Sasl]
$ Vi conf/passwd
[Users]
Kaiwen01 = kaiwen01
Kaiwen02 = kaiwen02
Kaiwen03 = kaiwen03
$ Vi conf/authz
[Groups]
Develop = kaiwen01, kaiwen02
Java = kaiwen03
[Repos:/]
@ Develop = rw
[Repos:/permit]
@ Java = rw
* = R
Iv. Run
$ Chkconfig svnverve on
$/Etc/init. d/svnverve start
5. Check
$ Ps aux | grep svnserve
$ Netstat-ntlp | grep svnserve
# Default 3690 Port
Vi. Client running test
# Check out
# Submit
VII. Others (a script for automatically creating a project is attached, but it must be placed in the current folder of the project to be created)
$ Vi/var/subversion/svncreate. sh
#! /Bin/bash
#
Read-p "Project Name:" names
Svnadmin create $ names
Cat> $ names/conf/svnserve. conf <EOF
[General]
Anon-access = none
Auth-access = write
Password-db = passwd
Authz-db = authz
[Sasl]
EOF
Cat> $ names/conf/passwd <EOF
[Users]
$ {Names }=$ {names}-pass
$ {Names }=$ {names}-pass
EOF
Cat> $ names/conf/authz <EOF
[Groups]
Develop =$ {names}, $ {names}
[$ Names:/]
@ Develop = rw
EOF
Subversion configuration instances in Linux
CentOS 6.2 SVN setup (YUM installation)
Build an SVN server using Apache + SVN
Set up and use the SVN server in Windows + reset the password on the client
Install SVN in Ubuntu Server 12.04 and migrate Virtual SVN data
Build svn service and migration method on Ubuntu Server
Build SVN server with online storage
This article permanently updates the link address: