centos 6 下安装svn服务端

  1. 安装SVN

    [root@localhost modules]# yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql
  2. 确认已安装了svn模块

    [root@localhost /]# cd /etc/httpd/modules
    [root@localhost modules]# ls | grep svn
    mod_authz_svn.so
    mod_dav_svn.so
  3. 验证安装

    [root@localhost modules]# svnserve --version
  4. 代码库创建

    [root@localhost modules]# mkdir -p /home/repositories
    [root@localhost modules]# svnadmin create /home/repositories
  5. 配置代码库

    进入上面生成的文件夹conf下,进行配置 
    [root@localhost modules]# cd /home/repositories/conf
  6. 用户密码passwd配置

    [root@admin conf]# vi + passwd         
  7.  [users]
    # harry = harryssecret
    # sally = sallyssecret
    gaoxiang=123456
             
  8. 权限控制authz配置

    [root@admin conf]# vi + authz
    目的是设置哪些用户可以访问哪些目录,向authz文件追加以下内容:
     #设置[/]代表根目录下所有的资源 
     [/]
     gaoxiang=rw

    9. 

服务svnserve.conf配置

[root@admin conf]# vi + svnserve.conf


[general]
#匿名访问的权限,可以是read,write,none,默认为read
anon-access=none
#使授权用户有写权限 
auth-access=write
#密码数据库的路径 
password-db=passwd
#访问控制文件 
authz-db=authz
#认证命名空间,subversion会在认证提示里显示,并且作为凭证缓存的关键字 
realm=/home/repositories





配置防火墙(嫌麻烦的同学可以直接关闭防火墙)

[root@localhost conf]# vi /etc/sysconfig/iptables
添加以下内容: 
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
保存后重启防火墙 
[root@localhost conf]# service iptables restart

启动SVN

svnserve -d -r /opt/svn/repositories


停止重启SVN

[root@localhost password]# killall svnserve    //停止 
[root@localhost password]# svnserve -d -r /opt/svn/repositories  // 启动


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章