详细CentOS-6.3安装配置SVN的方法
安装说明
系统环境:CentOS-6.3
安装方式:yuminstall(源码安装容易产生版本兼容的问题)
安装软件:系统自动下载SVN软件
检查已安装版本
#检查是否安装了低版本的SVN
[root@localhost/]#rpm-qasubversion
#卸载旧版本SVN
[root@localhostmodules]#yumremovesubversion
安装SVN
[root@localhostmodules]#yuminstallhttpdhttpd-develsubversionmod_dav_svnmod_auth_mysql
确认已安装了svn模块
[root@localhost/]#cd/etc/httpd/modules [root@localhostmodules]#ls|grepsvn mod_authz_svn.so mod_dav_svn.so
验证安装
检验已经安装的SVN版本信息
[root@localhostmodules]#svnserve--version
svnserve,版本1.6.11(r934486) 编译于Jun232012,00:44:03 版权所有(C)2000-2009CollabNet。 Subversion是开放源代码软件,请参阅http://subversion.tigris.org/站点。 此产品包含由CollabNet(http://www.Collab.Net/)开发的软件。 下列版本库后端(FS)模块可用: *fs_base:模块只能操作BDB版本库。 *fs_fs:模块与文本文件(FSFS)版本库一起工作。 CyrusSASL认证可用。
代码库创建
SVN软件安装完成后还需要建立SVN库
[root@localhostmodules]#mkdir-p/opt/svn/repositories [root@localhostmodules]#svnadmincreate/opt/svn/repositories
执行上面的命令后,自动建立repositories库,查看/opt/svn/repositories文件夹发现包含了conf,db,format,hooks,locks,README.txt等文件,说明一个SVN库已经建立。
配置代码库
进入上面生成的文件夹conf下,进行配置
[root@localhostmodules]#cd/opt/svn/repositories/conf
用户密码passwd配置
[root@localhostpassword]#cd/opt/svn/repositories/conf [root@adminconf]#vi+passwd
修改passwd为以下内容:
[users] #harry=harryssecret #sally=sallyssecret zhoulf=123456
权限控制authz配置
[root@adminconf]#vi+authz
目的是设置哪些用户可以访问哪些目录,向authz文件追加以下内容:
#设置[/]代表根目录下所有的资源 [/] zhoulf=rw
服务svnserve.conf配置
[root@adminconf]#vi+svnserve.conf
追加以下内容:
[general] #匿名访问的权限,可以是read,write,none,默认为read anon-access=none #使授权用户有写权限 auth-access=write #密码数据库的路径 password-db=passwd #访问控制文件 authz-db=authz #认证命名空间,subversion会在认证提示里显示,并且作为凭证缓存的关键字 realm=/opt/svn/repositories
配置防火墙端口
[root@localhostconf]#vi/etc/sysconfig/iptables
添加以下内容:
-AINPUT-mstate--stateNEW-mtcp-ptcp--dport3690-jACCEPT
保存后重启防火墙
[root@localhostconf]#serviceiptablesrestart
启动SVN
svnserve-d-r/opt/svn/repositories
查看SVN进程
[root@localhostconf]#ps-ef|grepsvn|grep-vgrep root125381014:40?00:00:00svnserve-d-r/opt/svn/repositories
检测SVN端口
[root@localhostconf]#netstat-ln|grep3690 tcp000.0.0.0:36900.0.0.0:*LISTEN
停止重启SVN
[root@localhostpassword]#killallsvnserve//停止 [root@localhostpassword]#svnserve-d-r/opt/svn/repositories//启动
测试
SVN服务已经启动,使用客户端测试连接。
客户端连接地址:svn://192.168.15.231
用户名/密码:zhoulf/123456
测试创建文件夹等操作。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。