参考于http://wiki.centos.org/HowTos/Subversion
Once you upload your original layout from the local SVN server, you're now free to use it remotely on another machine.
1.yum install httpd httpd-devel subversion mod_dav_svn mod_auth_mysql
安装相关的软件。
2.vim /etc/httpd/conf/httpd.conf
配置httpd的相关选项,一般不用配置。
chkconfig httpd on
设置为开机启动。
3.vim /etc/httpd/conf.d/subversion.conf/
<Location /repos>
DAV svn
SVNPath /var/svn/www/repos #版本库的位置
#
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /etc/svn-auth-conf #用户授权文件的位置
Require valid-user
# </LimitExcept>
</Location>
4.htpasswd -cm /etc/svn-auth-conf yourusername
创建密码文件,指定用户名和密码。
htpasswd -m /etc/svn-auth-conf anotherusername可以创建其他用户。
5.mkdir -p /var/www/svn #创建目录
cd /var/www/svn;svnadmin create repos #创建版本库
chown -R apache.apache repos #设定用户和用户组
service httpd restart
######################################################
创建目录和文件,使用svn import /tmp/mytestproj/ file:///var/www/svn/repos/mytestproj -m "Initial repository layout for mytestproj" 相关命令
导入文件到版本库中,创建了版本库的项目。
svn co http://yoursvnserver/repos/mytestproj,将版本库中的项目checkout出来。
svn commit -m "Added a line to testconf1.cfg." 提交修改。
######################################################
1.db/txn-current-lock权限不够
chmod -R 777 repos/
2.Could not open the requested SVN filesystem error=2
不要将SVNPath,写成SVNParentPath
3.删除增加文件
svn co 到本地,再用svn delete,svn copy等操作,最后再svn ci到版本库中,svn ci不需要加入url
4.查看版本库中的项目
svn list