本安装教程基于centos7
1、安装
yum install subversion
2、新建一个目录用于存储SVN所有文件
mkdir /usr/local/svn
3、新建一个资源仓库
svnadmin create /usr/local/svn/project
4、配置SVN服务的配置文件svnserve.conf文件
vi /usr/local/svn/project/conf/svnserve.conf
[general] anon-access=none auth-access=write password-db=/usr/local/svn/project/conf/passwd authz-db=/usr/local/svn/project/conf/authz realm=/usr/local/svn/project(这里要根据你自己的svn仓库来写) |
5、添加用户及口令
vi /usr/local/svn/project/conf/passwd
[users]
your_name=your_pwd
示例
[users] admin=admin |
vi /usr/local/svn/project/conf/authz
[groups] admin=your_name [/] @admin=rw |
7、启动服务
svnserve -d -r /usr/local/svn/
8、查看服务是否正常运行
ps -ef|grep svnserve
或者
ps aux|grep svnserve #默认端口为:3690
9、杀掉当前服务
kill -9 your_pid_number
10. 为设置开机启动做准备
#注意:由于centos7安装svn时,系统默认的svn根目录为/var/svn,所以需要对配置文件/etc/sysconfig/svnserve修改成你自己的svn根目录才能, 这样才能设置成功!!
vi /etc/sysconfig/svnserve
#OPTIONS="-r /var/svn"(将默认的注掉)
OPTIONS="-r /usr/local/svn/project"(这里是自己的svn根目录)
[root@iZuf6hmkcpexishpa3id8xZ etc]# cat /etc/sysconfig/svnserve Display all 191 possibilities? (y or n) [root@iZuf6hmkcpexishpa3id8xZ etc]# cat /etc/sysconfig/svnserve # OPTIONS is used to pass command-line arguments to svnserve. # # Specify the repository location in -r parameter: #OPTIONS="-r /var/svn" OPTIONS="-r /usr/local/svn/project" |
11.设置开机启动
systemctl enable svnserve.service #设置开机启动后就可以按下面的方式开启或停止服务了 systemctl start svnserve.service systemctl stop svnserve.service |
12.参考博客:
http://blog.csdn.net/ghlfllz/article/details/53943162
http://blog.csdn.net/u012486840/article/details/52524389