1,安装:缓存
# yum install subversion
判断是否安装成功:服务器
# svnserve –version
2,创建SVN库:svn
# mkdir /opt/svn/repos # svnadmin create /opt/svn/repos
执行上面的命令后,自动在repos下创建多个文件, 分别是conf, db,format,hooks, locks, README.txt。spa
----------------------------------------------------------------------------------------------------code
3,设置passwdorm
# nano /opt/svn/repos/conf/passwd
[users] # harry = harryssecret # sally = sallyssecret username = password #这样咱们就创建了用户username
4,设置authzserver
# nano /opt/svn/repos/conf/authz
[/] username = rw # [/] 意思为全部目录 # username = rw 意思为username拥有读写权限 # 合起来就是username对全部目录拥有读写权限
5,设置svnserv.confit
# nano /opt/svn/repos/conf/svnserv.conf
anon-access = none # 使非受权用户没法访问 auth-access = write # 使受权用户有写权限 password-db = password # 指定password authz-db = authz # 访问控制文件 realm = /opt/svn/repos # 认证命名空间,subversion会在认证提示里显示,而且做为凭证缓存的关键字。
采用默认配置. 以上语句都必须顶格写, 左侧不能留空格, 不然会出错.io
----------------------------------------------------------------------------------------------------form
6,链接
启动svn:
# svnserve -d -r /opt/svn/repos
若是已经有svn在运行,能够换一个端口运行(默认端口为:3690):
svnserve -d -r /opt/svn/repos --listen-port 3691
这样同一台服务器能够运行多个svnserver
连接地址为:
svn://localhost:3690
完!