CentOS 5.x /RHEL 5.x
3 安装svn
[root@svn ~]# yum install mod_dav_svn subversion
4 配置subversion.conf
[root@svn ~]#more /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, "/var/www/svn". Each repository
# must be readable and writable by the 'apache' user. Note that if
# SELinux is enabled, the repositories must be labelled with a context
# which httpd can write to; this will happen by default for
# directories created in /var/www. Use "restorecon -R /var/www/svn"
# to label the repositories if upgrading from a previous release.
#
#
# To create a new repository "http://localhost/repos/stuff" using
# this configuration, run as root:
#
# # cd /var/www/svn
# # svnadmin create stuff
# # chown -R apache.apache stuff
#
<Location />
DAV svn
SVNParentPath /opt/svn/
AuthzSVNAccessFile /etc/httpd/conf.d/authz
AuthType Basic
AuthName "Subversion repos"
AuthUserFile /etc/httpd/conf.d/passwd
Require valid-user
</Location>
#htpasswd add user
[root@svn ~]htpasswd -cm /etc/httpd/conf.d/passwd yourusername
5 配置svn
[root@svn ~] mkdir /opt/svn/ -- Or wherever you placed your path above
[root@svn ~] cd /opt/svn/
#create svn ...
[root@svn ~] svnadmin create repos
[root@svn ~] chown -R apache.apache repos
[root@svn ~] service httpd restart
6 svn操作
#mkdir svn files
[root@svn ~] cd /tmp
[root@svn ~] mkdir mytestproj/{configurations,options,main} -p
[root@svn ~] vim configurations/testconf1.cfg -- Add whatever you want to these files
[root@svn ~] vim options/testopts1.cfg
[root@svn ~] vim main/mainfile1.cfg
#import
[root@svn ~] svn import /tmp/mytestproj/ file:///opt/svn/repos/mytestproj -m "Initial repository layout for mytestproj"
Adding /tmp/mytestproj/main
Adding /tmp/mytestproj/main/mainfile1.cfg
Adding /tmp/mytestproj/configurations
Adding /tmp/mytestproj/configurations/testconf1.cfg
Adding /tmp/mytestproj/options
Adding /tmp/mytestproj/options/testopts1.cfg
#checking out
[root@svn ~] cd /home
[root@svn home] svn co
Authentication realm: <:80> Subversion repos
Password for 'youruser':
A mytestproj/main
A mytestproj/main/mainfile1.cfg
A mytestproj/configurations
A mytestproj/configurations/testconf1.cfg
A mytestproj/options
A mytestproj/options/testopts1.cfg
Checked out revision 1