Article From:https://www.cnblogs.com/weiweictgu/p/9121514.html

 

1、First check whether there is SVN, no need to install SVN.

svnserve --version #Look at the SVN version numberwhich svn #Look at the directory of the SVN programyum install subversion -y #Install SVNSystemctlcat svnserve.service #View the system configuration file

 

2、Modify the directories in the SVN global configuration file

3、Create a SVN version Library

sudo svnadmin create /opt/svn/topevery

4、Modify authz, passwd, and svnserve.conf three files to establish user group, user and directory permissions.

authz

[groups]
manager=wilson
dev=wilson01

[/]
@manager=rw
[/UI]
@dev]

 

passwd

[users]
# harry = harryssecret
# sally = sallyssecret
wilson=123
wilson01=1234

 

svnserve.conf

 

[general]

anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = topevery
[sasl]

 5、Edit service configuration file

In the /etc/init.d directory, create a script svnd

touch svnd  
chmod u+x svnd  

svndThe contents of the file are as follows

#!/bin/sh
# chkconfig: 2345 10 90
# description: svn server
SVN_HOME=/opt/svn/topevery
if [ ! -f "/usr/bin/svnserve" ]
then
echo "svnserver startup: cannot start"
exit
fi
case "$1" in
start)
echo "Starting svnserve…"
/usr/bin/svnserve -d --listen-port 3690 -r $SVN_HOME
echo "Finished!"
;;
stop)
echo "Stoping svnserve…"
killall svnserve
echo "Finished!"
;;
restart)
$0 stop
$0 start
 
;;
*)
echo "Usage: svn { start | stop | restart } "
exit 1
esac

svnd

Start SVN

service svnd start  

 

6、Open firewall port

firewall-cmd --zone=public --add-port=3690/tcp --permanent 

firewall-cmd --reload  

 

netstat -ln | grep 3690  
ps aux|grep svnserve

7、Set the SVN service to self start

chkconfig --add svnd  
chkconfig svnd on  

 

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *