svn常用命令

阅读更多

1 启动命令

svnserve -d -r /opt/svn

-d 守护 -r 后台

 

2 停止

直接ps -ef | grep svnserve

然后 kill

 

3 新建一个仓库 

svnadmin create test

这个时候要改一下owner 

chown -R apache  test

 

4 删除一个仓库

直接rm -rf xxx

 

5 备份一个仓库

svnadmin hotcopy xxx /opt/xxx_20161226

然后把仓库直接解压到svn下面的文件夹下面就ok

 

6 安装apache+svn,可以参照 http://blog.csdn.net/apache0554/article/details/46906973

 

yum install httpd

#安装svn服务和httpd模块

yum install subversion mod_dav_svn 

 

然后配置

 

写道
[root@localhost conf.modules.d]# cat /etc/httpd/conf.modules.d/10-subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule dontdothat_module modules/mod_dontdothat.so

DAV svn
SVNParentPath /opt/svn

# SSLRequireSSL
AuthType Basic
AuthName "Subversion"
AuthUserFile /opt/svn/.htpasswd
require valid-user
AuthzSVNAccessFile /opt/svn/authz

# # Limit write permission to list of valid users.
#
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
# AuthType Basic
# AuthName "Authorization Realm"
# AuthUserFile /path/to/passwdfile
# Require valid-user
#

 

7 扩展svn的分区

因为svn用的分区容量太小,就重新加了个分区

mount也没什么问题

查看/var/log/httpd/error_log,一直提示权限问题,设定777或者改owner都不行

写道
[Tue Dec 27 22:09:12.484060 2016] [authz_svn:error] [pid 10527] (13)Permission denied: [client 10.149.243.123:58908] Failed to load the AuthzSVNAccessFile: Can't open file '/opt/svn/authz': Permission denied
[Tue Dec 27 22:09:12.487699 2016] [authn_file:error] [pid 10527] (13)Permission denied: [client 10.149.243.123:58908] AH01620: Could not open password file: /opt/svn/.htpasswd

 

我就奇怪了。。结果查了下之后是selinux。。

查看getenforce

关闭setenforce 0

 

8 加用户

htpasswd /opt/svn/.htpasswd  xxxx

 

你可能感兴趣的:(svn常用命令)