作者:手机用户2502931101 | 来源:互联网 | 2023-09-24 18:37
综合:https:www.cnblogs.comliuxf88p6402670.htmlhttps:blog.csdn.netqq_27868061articlede
综合:
https://www.cnblogs.com/liuxf88/p/6402670.html
https://blog.csdn.net/qq_27868061/article/details/81094187
下载subversion、apr、apr-util、sqlite-amalgamation:
-
wget https://mirrors.tuna.tsinghua.edu.cn/apache/subversion/subversion-1.9.3.tar.gz
-
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-util-1.6.1.tar.gz
-
wget https://mirrors.tuna.tsinghua.edu.cn/apache/apr/apr-1.6.5.tar.gz
-
wget https://www.sqlite.org/2018/sqlite-amalgamation-3240000.zip
编译
1、安装 apr(使用root)
#tar -zxvf apr-1.5.5
.tar.gz
#cd apr-1.5.5
#./configure --prefix=/usr/local/apr && make && make install
2、安装apr-util(使用root)
#tar -zxvf apr-util-1.6.1.tar.gz
#cd apr-util-1.6.1
#./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr && make && make install
3、安装sqlite
#tar -zxfv sqlite-autoconf-3130000.tar.gz
#cd sqlite-autoconf-3130000
#./configure --prefix=/usr/local/sqlite && make && make install
4、安装subversion
#tar -zxvf subversion-1.9.5.tar.gz
#cd subversion-1.9.5
#./configure --prefix=/usr/local/svn --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-sqlite=/usr/local/sqlite --with-zlib=/usr/local/zlib && make && make install
配置相关属性
1、设置系统环境变量
#vi /etc/profile(ps:调整系统环境变量时,请先备份profile文件。)
export PATH=/usr/local/svn/bin:$PATH (文件末尾添加)
#source /etc/profile
2、测试subversion
#svnserve --version
3、配置资源库
#mkdir -p /home/svn/project
#svnadmin create /home/svn/project
4、配置svn服务的配置文件svnserver.conf文件
#vi $SVN/conf/svnserver.conf
anon-access = none 注释去掉
auth-access = write 注释去掉
password-db = passwd 注释去掉
authz-db = authz 注释去掉
5、配置SVN访问用户
#vi $svn/conf/passwd
test1 = 123456
test2 = 123456
6、配置新用户的授权文件
#vi $svn/conf/passwd
[groups]
组名1 = 用户
组名2 = 用户
……
……
[/] #针对主目录的权限设置,管理员可读写,普通用户读权限。
@组名 = rw(读写权限)
@组名 = r(读权限)
[project/目录] #组1可读写,组2可读
@组名 = rw (读写权限)
@组名 = r
[project/目录/目录] #同上
@组名 = rw
@组名 = r
后续配置
1、添加svn以service方式启动
#vi /usr/local/svn/svnserved
#!/bin/sh
# chkconfig: 2345 85 85
# processname: svn
svn_port=3690
svn_home=/usr/local/svn
if [ ! -f "$svn_home/bin/svnserve" ]
then
echo "svnserver startup: cannot start"
exit
fi
case "$1" in
start)
echo "Starting svnserve..."
$svn_home/bin/svnserve -d -r $svn_home/project --listen-port $svn_port
echo "Successfully!"
;;
stop)
echo "Stoping svnserve..."
killall svnserve
echo "Successfully!"
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: svn { start | stop | restart } "
exit 1
esac
2、将文件复制到/etc/init.d/中
#chmod +x /usr/local/svn/svnserverd
#cp /usr/local/svn/svnserverd /etc/init.d/
3、添加系统服务
#chkconfig --add svnserverd
完成!