Centos 7.5下搭建SVN源代码服务器

 

一、先查看是否存在svn,没有就须要安装svnlinux

svnserve --version #查看svn版本号
which svn #查看svn程序所在目录
yum install subversion -y #安装svn
systemctl cat svnserve.service #查看系统配置文件

 

二、修改svn全局配置文件中指向的目录vim

三、建立svn版本库tcp

sudo svnadmin create /opt/svn/topevery

四、修改authz、passwd、 svnserve.conf三个文件创建用户组、用户、目录权限ide

authzsvn

[groups]
manager=wilson
dev=wilson01

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

 

passwdspa

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

 

svnserve.conf3d

 

[general]

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

 五、编辑服务配置文件rest

在 /etc/init.d 目录下,建立脚本 svndcode

touch svnd  
chmod u+x svnd  

svnd文件内容以下server

#!/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

启动svn 

service svnd start  

 

六、开放防火墙端口

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

firewall-cmd --reload  

 

netstat -ln | grep 3690  
ps aux|grep svnserve

七、设置svn服务为自启动

chkconfig --add svnd  
chkconfig svnd on  

 

 

遇到的问题及解决方法

一、Can't open file '/opt/svn/topevery/db/txn-current-lock': Permission denied

关闭SELinux

[root@localhost ~]# getenforce
Enforcing

[root@localhost ~]# vim /etc/selinux/config

将SELINUX=enforcing改成SELINUX=disabled,保存后退出

 

二、

相关文章
相关标签/搜索