`

SVN 安装

 
阅读更多

项目需要 SVN 来管理,以前都只是在用,正好有时间,学习下怎么安装。

以下是安装步骤 留做笔记:

环境:  使用 cat /etc/redhat-release 查看
        虚拟机 :Red Hat Enterprise Linux Server release 6.0 (Santiago)   

跟据百度文库http://wenku.baidu.com/view/8817db146edb6f1aff001f29.html

        需要依赖:apr-1.3 、sqlite-amalgamation-3.6、httpd-2.2

本机安装包: rpm -qa |grep sqlite
sqlite-3.6.20-1.el6.i686
若没有安装sqlite  请使用命令: yum install sqlite 来安装 ,参见 yum的使用

安装subversion :

yum install subversion

等待自动安装完成后,查看subversion 的安装文件位置

rpm -ql | grep subversion

建立版本库

mkdir  -p  /opt/svn

svnadmin create /opt/svn/repository

ll /opt/svn/repository

有内容显示 说明版本库建立成功

vi /opt/svn/repository/conf/svnserve.conf

修改[general]的内容

anon-access = none  #匿名用户访问权限,默认 read 建议none

auth-access = write   #验证用户访问权限默认write 建议write

password-db = /opt/svn/repository/conf/passwd.conf  #密码库

authz-db = /opt/svn/authz.conf  #用户、组配置文件

realm = repository # 版本库名称

保存退出。

创建svn用户,也就是客户端的登录用户

htpasswd -c /opt/svn/htpasswd admin

注:第一次创建用户时要加参数 -c  的意思是:如果htpasswd存在 将覆盖写入,再创建用户时也是此命令不过不需要加 -c 参数

新加用户user

htpasswd /opt/svn/htpasswd user

 

用户配置文件

vi /opt/svn/repository/conf/passwd.conf

在最下面加上

用户名 = 密码

admin = admin   #行前面不要留空格,当然也不能有#

user = user

 

权限配置文件

vi /opt/svn/authz.conf

写入如下代码

[groups]

admin=admin,user  #组下的多用户需要用逗号分开

 

[/]  #顶级目录

@admin=rw #代表admin组的所有成员有读写权限

 

启动svn 服务

svnserve -d --listen-port 9999 -r /opt/svn/repository

-d 后台程序

9999 监听端口

-r 版本库路径

 

查看服务是否正常启动

ps aux|grep svnserve

 

客户端 check out: svn://172.19.121.125:9999/

 

Myeclipse check out:  svn://172.19.121.125:9999/

 

若不能成功尝试 重启 httpd、svnserve

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics