Chinaunix首页 | 论坛 | 博客
  • 博客访问: 219853
  • 博文数量: 39
  • 博客积分: 945
  • 博客等级: 准尉
  • 技术积分: 532
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-04 17:25
文章分类

全部博文(39)

文章存档

2012年(39)

我的朋友

分类: LINUX

2012-05-07 11:54:53

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. LoadModule dav_svn_module modules/mod_dav_svn.so
  3. LoadModule authz_svn_module modules/mod_authz_svn.so

  4. # Example configuration to enable HTTP access for a directory
  5. # containing Subversion repositories, "/var/www/svn". Each repository
  6. # must be readable and writable by the 'apache' user. Note that if
  7. # SELinux is enabled, the repositories must be labelled with a context
  8. # which httpd can write to; this will happen by default for
  9. # directories created in /var/www. Use "restorecon -R /var/www/svn"
  10. # to label the repositories if upgrading from a previous release.
  11. #

  12. #
  13. # To create a new repository "" using
  14. # this configuration, run as root:
  15. #
  16. # # cd /var/www/svn
  17. # # svnadmin create stuff
  18. # # chown -R apache.apache stuff
  19. #

  20. <Location />
  21.       DAV svn
  22.       SVNParentPath /opt/svn/
  23.       AuthzSVNAccessFile /etc/httpd/conf.d/authz
  24.       AuthType Basic
  25.       AuthName "Subversion repos"
  26.       AuthUserFile /etc/httpd/conf.d/passwd
  27.       Require valid-user
  28. </Location>

  29. #htpasswd add user
  30. [root@svn ~]htpasswd -cm /etc/httpd/conf.d/passwd yourusername


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

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










阅读(2827) | 评论(1) | 转发(1) |
给主人留下些什么吧!~~

十七岁的回忆2012-05-08 19:30:51

多谢了,正在找这个东西,很及时啊~博主好人。。。