服务器技术

 首页 > 服务器技术 > Linux > Linux配置安装svn服务端、客户端应用的例子

Linux配置安装svn服务端、客户端应用的例子

分享到:
【字体:
导读:
          安装svn对于团队开发与版本控制的朋友肯定是会用到了,今天,我们来看在Linux配置安装svn服务端、客户端应用的例子,希望这个例子能给各位带来有效帮助. Linux配置安装svn服务,此次配置环...

安装svn对于团队开发与版本控制的朋友肯定是会用到了,今天,我们来看在Linux配置安装svn服务端、客户端应用的例子,希望这个例子能给各位带来有效帮助.

Linux配置安装svn服务,此次配置环境为centos6.6,内核版本2.6.32.

  1. Last login: Sat Mar 14 06:12:56 2015 
  2. [root@Svn-Server ~]# cat /etc/redhat-release  
  3. CentOS release 6.6 (Final) 
  4. [root@Svn-Server ~]# uname -rm 
  5. 2.6.32-504.el6.x86_64 x86_64 
  6. [root@Svn-Server ~]# rpm -qa subversion 
  7. [root@Svn-Server ~]# yum install subversion -y 
  8. Dependencies Resolved 
  9.  Package                                Arch                    Version                               Repository                Size 
  10. Installing: 
  11.  subversion                             x86_64                  1.6.11-12.el6_6                       updates                  2.3 M 
  12. Installing for dependencies: 
  13.  apr                                    x86_64                  1.3.9-5.el6_2                         base                     123 k 
  14.  apr-util                               x86_64                  1.3.9-3.el6_0.1                       base                      87 k 
  15.  gnutls                                 x86_64                  2.8.5-14.el6_5                        base                     346 k 
  16.  libproxy                               x86_64                  0.3.0-10.el6                          base                      39 k 
  17.  libproxy-bin                           x86_64                  0.3.0-10.el6                          base                     9.0 k 
  18.  libproxy-python                        x86_64                  0.3.0-10.el6                          base                     9.1 k 
  19.  neon                                   x86_64                  0.29.3-3.el6_4                        base                     119 k 
  20.  pakchois                               x86_64                  0.4-3.2.el6                           base                      21 k 
  21.  perl                                   x86_64                  4:5.10.1-136.el6_6.1                  updates                   10 M 
  22.  perl-Module-Pluggable                  x86_64                  1:3.90-136.el6_6.1                    updates                   40 k 
  23.  perl-Pod-Escapes                       x86_64                  1:1.04-136.el6_6.1                    updates                   32 k 
  24.  perl-Pod-Simple                        x86_64                  1:3.13-136.el6_6.1                    updates                  212 k 
  25.  perl-URI                               noarch                  1.40-2.el6                            base                     117 k 
  26.  perl-libs                              x86_64                  4:5.10.1-136.el6_6.1                  updates                  578 k 
  27.  perl-version                           x86_64                  3:0.77-136.el6_6.1                    updates                   51 k 
  28. Transaction Summary 
  29. ===================================================================================================================================== 
  30. Install      16 Package(s) 
  31. [root@Svn-Server ~]# mkdir /byrd/svndata -p 
  32. [root@Svn-Server ~]# svnserve -d -r /byrd/svndata/ 
  33. [root@Svn-Server ~]# ps -ef |grep svn 
  34. root      1216     1  0 06:31 ?        00:00:00 svnserve -d -r /byrd/svndata/ 
  35. [root@Svn-Server ~]# rpm -qa subversion 
  36. subversion-1.6.11-12.el6_6.x86_64 
  37. [root@Svn-Server ~]# netstat -tunlp    #lsof -i :3690 
  38. Active Internet connections (only servers) 
  39. Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name    
  40. tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1053/sshd            
  41. tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1130/master          
  42. tcp        0      0 0.0.0.0:3690                0.0.0.0:*                   LISTEN      1216/svnserve        
  43. tcp        0      0 :::22                       :::*                        LISTEN      1053/sshd            
  44. tcp        0      0 ::1:25                      :::*                        LISTEN      1130/master          
  45. [root@Svn-Server ~]# which svnadmin 
  46. /usr/bin/svnadmin 
  47. [root@Svn-Server ~]# svnadmin create /byrd/svndata/linuxerdox     #创建svn版本库(This is a Subversion repository) 
  48. [root@Svn-Server ~]# cd /byrd/svndata/linuxerdox/conf/ 
  49. [root@Svn-Server conf]# cp svnserve.conf svnserve.$(date +%F).conf    #备份svnserve.conf配置文件 
  50. [root@Svn-Server conf]# sed -i 's## anon-access = read#anon-access = none#g' svnserve.conf     #取消svn匿名访问 
  51. [root@Svn-Server conf]# sed -i 's## auth-access = write#auth-access = write#g' svnserve.conf 
  52. [root@Svn-Server conf]# mkdir /byrd/svnpasswd    #创建公共密码区域 
  53. [root@Svn-Server conf]# sed -i 's/# password-db = passwd/password-db = /byrd/svnpasswd/passwd/g' svnserve.conf 
  54. [root@Svn-Server conf]# sed -i 's/# authz-db = authz/authz-db = /byrd/svnpasswd/authz/g' svnserve.conf 
  55. [root@Svn-Server conf]# diff svnserve.* 
  56. 12,13c12,13 
  57. < # anon-access = read 
  58. < # auth-access = write 
  59. --- 
  60. > anon-access = none 
  61. > auth-access = write 
  62. 20c20 
  63. < # password-db = passwd 
  64. --- 
  65. > password-db = /byrd/svnpasswd/passwd 
  66. 27c27 
  67. < # authz-db = authz 
  68. --- 
  69. > authz-db = /byrd/svnpasswd/authz 
  70. [root@Svn-Server conf]# cp authz passwd /byrd/svnpasswd/ 
  71. [root@Svn-Server conf]# chmod 700 /byrd/svnpasswd/* 
  72. [root@Svn-Server conf]# ll /byrd/svnpasswd/ 
  73. total 8 
  74. -rwx------. 1 root root 1080 Mar 14 20:54 authz 
  75. -rwx------. 1 root root  309 Mar 14 20:54 passwd 
  76. [root@Svn-Server conf]# sed -i 's## harry = harryssecret#byrd = admin#g' /byrd/svnpasswd/passwd  
  77. [root@Svn-Server svndata]# tail -3 /byrd/svnpasswd/authz   
  78. [linuxerdox:/] 
  79. byrd = rw 
  80. * =  
  81. [root@Svn-Server svndata]# netstat -tunlp 
  82. Active Internet connections (only servers) 
  83. Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name    
  84. tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1052/sshd            
  85. tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1129/master          
  86. tcp        0      0 0.0.0.0:3690                0.0.0.0:*                   LISTEN      1267/svnserve        
  87. tcp        0      0 :::22                       :::*                        LISTEN      1052/sshd            
  88. tcp        0      0 ::1:25                      :::*                        LISTEN      1129/master         //phpfensi.com 
  89. [root@Svn-Server svndata]# pkill svnserve 
  90. [root@Svn-Server svndata]# svnserve -d -r /byrd/svndata/ 

linux作为客户端:

  1. co:checkout 
  2. ci:commit 
  3. up:update 
  4. ls:list 
  5. [root@Svn-Server linuxerdox]# svn co svn://1.1.1.32/linuxerdox /tmp/ --username=byrd --password=admin 
  6. ----------------------------------------------------------------------- 
  7. ATTENTION!  Your password for authentication realm: 
  8.     3c9e524f-5a71-49bf-92d5-0a9b8d86bc7e 
  9. can only be stored to disk unencrypted!  You are advised to configure 
  10. your system so that Subversion can store passwords encrypted, if 
  11. possible.  See the documentation for details. 
  12. You can avoid future appearances of this warning by setting the value 
  13. of the 'store-plaintext-passwords' option to either 'yes' or 'no' in 
  14. '/root/.subversion/servers'. 
  15. ----------------------------------------------------------------------- 
  16. Store password unencrypted (yes/no)? no 
  17. Checked out revision 3. 
  18. [root@Svn-Server linuxerdox]# svn co svn://1.1.1.32/linuxerdox /tmp/ --username=byrd --password=admin 
  19. A    /tmp/111.txt 
  20. Checked out revision 4. 
  21. [root@Svn-Server linuxerdox]# ll /tmp/ 
  22. total 4 
  23. -rw-r--r--. 1 root root 46 Mar 14 21:45 111.txt 
  24. [root@Svn-Server linuxerdox]# touch /tmp/abc.txt 
  25. [root@Svn-Server linuxerdox]# svn add /tmp/abc.txt  
  26. A         /tmp/abc.txt 
  27. [root@Svn-Server linuxerdox]# svn ci 
  28. svn: '/byrd/svndata/linuxerdox' is not a working copy 
  29. [root@Svn-Server linuxerdox]# svn ci -m "abc" 
  30. svn: '/byrd/svndata/linuxerdox' is not a working copy 
  31. [root@Svn-Server linuxerdox]# cd /tmp/ 
  32. [root@Svn-Server tmp]# svn ci -m "abc" 
  33. Authentication realm:  3c9e524f-5a71-49bf-92d5-0a9b8d86bc7e 
  34. Password for 'byrd': 
  35. ----------------------------------------------------------------------- 
  36. ATTENTION!  Your password for authentication realm: 
  37.     3c9e524f-5a71-49bf-92d5-0a9b8d86bc7e 
  38. can only be stored to disk unencrypted!  You are advised to configure 
  39. your system so that Subversion can store passwords encrypted, if 
  40. possible.  See the documentation for details. 
  41. You can avoid future appearances of this warning by setting the value 
  42. of the 'store-plaintext-passwords' option to either 'yes' or 'no' in 
  43. '/root/.subversion/servers'. 
  44. ----------------------------------------------------------------------- 
  45. Store password unencrypted (yes/no)? no 
  46. Adding         abc.txt 
  47. Transmitting file data . 
  48. Committed revision 5. 
  49. [root@Svn-Server tmp]# svn co file:///byrd/svndata/linuxerdox /tmp/ --username=byrd --password=admin 
  50. svn: '/tmp' is already a working copy for a different URL 
  51. [root@Svn-Server tmp]# ll 
  52. total 0 
  53. -rw-r--r--. 1 root root 0 Mar 14 22:10 abc.txt 
  54. -rw-------. 1 root root 0 Feb 10 17:11 yum.log 

到此配置完成,记得要防火墙开启对应的端口,当然你可以临时关闭防火墙,THX.

      上一篇:Linux开启mysql远程连接方法与问题解决办法 下一篇:linux中shell test 条件表达式说明
    分享到:
    [转]redhat下使用mysql,python,redis,...
    先给上一些网址,里面有各种问题与解决 1. httpsqs官方网址 2. python安装与使用mysql 3.mysql插入数据时:Incorrect string value 4.mysql显示中文乱码 5.修改mysql默认编码 6.linux开机以root身份启动一个脚本 注意:一下的操作建议全部以root身份运行,不然会出现很多权限问题。。。很烦恼 其实碰到的问题都是一些小...
    linux中shell test 条件表达式说明
    shell test 条件表达式对于很多的开发者来讲都是不很理解了,下文我来为各位介绍一些关于linux中shell test 条件表达式的说明与例子. 条件表达式("CONDITIONAL EXPRESSIONS") 条件表达式用于 [[ 复合命令以及内建命令 test 和 [ 中,用来测试文件属性,进行字符串和算术比较,表达式使用下面的单目或二进制操作构造,如...
    •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
    • 在这里……