当前位置: > Linux服务器 > SVN >

centos 5.x yum安装svn服务器

时间:2015-02-08 00:30来源:linux.it.net.cn 作者:IT
1 安装环境
  centos 5.x /RHEL 5.x
 
 2 安装lamp(略)
 
 3 安装svn

点击(此处)折叠或打开

  1. [root@svn ~]# yum install mod_dav_svn subversion
 4 配置subversion.conf

点击(此处)折叠或打开

  1. [root@svn ~]#more /etc/httpd/conf.d/subversion.conf
  2.  
  3. LoadModule dav_svn_module modules/mod_dav_svn.so
  4. LoadModule authz_svn_module modules/mod_authz_svn.so
  5.  
  6. # Example configuration to enable HTTP access for a directory
  7. # containing Subversion repositories, "/var/www/svn". Each repository
  8. # must be readable and writable by the 'apache' user. Note that if
  9. # SELinux is enabled, the repositories must be labelled with a context
  10. # which httpd can write to; this will happen by default for
  11. # directories created in /var/www. Use "restorecon -R /var/www/svn"
  12. # to label the repositories if upgrading from a previous release.
  13. #
  14.  
  15. #
  16. # To create a new repository "http://localhost/repos/stuff" using
  17. # this configuration, run as root:
  18. #
  19. # # cd /var/www/svn
  20. # # svnadmin create stuff 
  21. # # chown -R apache.apache stuff
  22. #
  23.  
  24. <Location />
  25.       DAV svn
  26.       SVNParentPath /opt/svn/
  27.       AuthzSVNAccessFile /etc/httpd/conf.d/authz
  28.       AuthType Basic
  29.       AuthName "Subversion repos"
  30.       AuthUserFile /etc/httpd/conf.d/passwd
  31.       Require valid-user
  32. </Location>
  33.  
  34. #htpasswd add user
  35. [root@svn ~]htpasswd -cm /etc/httpd/conf.d/passwd yourusername
  36.  
  37.  
5 配置svn

点击(此处)折叠或打开

  1. [root@svn ~] mkdir /opt/svn/ -- Or wherever you placed your path above
  2. [root@svn ~] cd /opt/svn/
  3. #create svn ...
  4. [root@svn ~] svnadmin create repos
  5. [root@svn ~] chown -R apache.apache repos
  6. [root@svn ~] service httpd restart
  7.  
6 svn操作

点击(此处)折叠或打开

  1. #mkdir svn files
  2.     [root@svn ~] cd /tmp
  3.     [root@svn ~] mkdir mytestproj/{configurations,options,main} -p
  4.     [root@svn ~] vim configurations/testconf1.cfg -- Add whatever you want to these files
  5.     [root@svn ~] vim options/testopts1.cfg
  6.     [root@svn ~] vim main/mainfile1.cfg
  7.     #import
  8.     [root@svn ~] svn import /tmp/mytestproj/ file:///opt/svn/repos/mytestproj -m "Initial repository layout for mytestproj"
  9.     Adding /tmp/mytestproj/main
  10.     Adding /tmp/mytestproj/main/mainfile1.cfg
  11.     Adding /tmp/mytestproj/configurations
  12.     Adding /tmp/mytestproj/configurations/testconf1.cfg
  13.     Adding /tmp/mytestproj/options
  14.     Adding /tmp/mytestproj/options/testopts1.cfg
  15.     #checking out
  16.     [root@svn ~] cd /home
  17.     [root@svn home] svn co http://yoursvnserver/repos/mytestproj
  18.     Authentication realm: &lt;http://yoursvnserver:80&gt; Subversion repos
  19.     Password for 'youruser':
  20.     A mytestproj/main
  21.     A mytestproj/main/mainfile1.cfg
  22.     A mytestproj/configurations
  23.     A mytestproj/configurations/testconf1.cfg
  24.     A mytestproj/options
  25.     A mytestproj/options/testopts1.cfg
  26.     Checked out revision 1
  27.  


(责任编辑:IT)
------分隔线----------------------------