Centos 搭建SVN服务器三步曲(个人成功配置)
1、【1】安装#yum install subversion 判断是否安装成功 #rpm –qa|grep subversion建立SVN库 先建立目录#mkdir /opt/svn/repos 建立版本库 #svnadmin create /opt/svn/repos 执行上面的命令后,自动在repos下建立多个文件, 分别是conf, db,format,hooks, locks, README.txt。【2】、配置#cd /opt/svn/repos 2.1先设置#vim passwd[users] hello=123 用户名=密码2.2 再设置权限vim authz[/] hello=rw2.3最后设定vim snvserv.confanon-access=none#使非授权用户无法访问 auth-access=write#使授权用户有写权限 password-db=password authz-db=authz#访问控制文件 realm=/opt/svn/repos#认证命名空间,subversion会在认证提示里显示,并且作为凭证缓存的关键字。采用默认配置. 以上语句都必须顶格写,左侧不能留空格,否则会出错.设置svn开机自启动 编辑文件 /etc/sysconfig/rc.local 添加一行 svnserve -d -r /var/svn/repositories或者使用系统已有的svnserve 服务/etc/init.d/svnserve 文件,通过配置/etc/sysconfig/svnserve#!/bin/bash OPTIONS=" -r /data/svn/repos"好了,通过以上配置,你的svn就可以了。【3】、连接启动svn:svnserve-d-r/opt/svn/repos 如果已经有svn在运行,可以换一个端口运行#svnserve-d-r/opt/svn/repos--listen-port3391 建议采用TortoiseSVN,连接地址为:svn://yourserveraddress(如果指定端口需要添加端口:端口号)连接后可以上传本地的文件,有效的管理你的代码。