Linux运维最佳实践pdf下载
yum -y install subversion #安装svn服务
1.创建版本库
/var/web_code/ #项目代码
mkdir /var/svn #新建一个目录用于存储SVN所有文件 执行完这一步,/var/svn 中将存在/var/svn/web_project文件夹,这个项目的配置都在 /var/svn/web_project/conf
svnadmin create /var/svn/web_project #建立空版本库
2.认证与授权
/var/svn/web_project/conf/svnserve.conf
[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz
realm = Repository1
3.http
yum -y install mod_dav_svn
yum -y install httpd
[root@iZ23n0ck9wqZ conf.d]# cat subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /var/svn
AuthType Basic
AuthName "Please input password"
AuthUserFile /var/svn/web_project/conf/passwd
AuthzSVNAccessFile /var/svn/web_project/conf/authz
Require valid-user
</Location>
chown -R apache.apahce /var/svn
/bin/systemctl start httpd.service
4.用户与密码
/var/svn/web_project/conf/passwd
htpasswd -c /var/svn/web_project/conf/passwd user1 第一个用户要加 -c
htpasswd /var/svn/web_project/conf/passwd user2
285 htpasswd /var/svn/web_project/conf/passwd user3
286 htpasswd /var/svn/web_project/conf/passwd user4
287 htpasswd /var/svn/web_project/conf/passwd user5
288 htpasswd /var/svn/web_project/conf/passwd user6
289 htpasswd /var/svn/web_project/conf/passwd user7
290 htpasswd /var/svn/web_project/conf/passwd user8
291 htpasswd /var/svn/web_project/conf/passwd user9
292 htpasswd /var/svn/web_project/conf/passwd user10
293 htpasswd /var/svn/web_project/conf/passwd user11
295 htpasswd /var/svn/web_project/conf/passwd user12
296 htpasswd /var/svn/web_project/conf/passwd user13
297 htpasswd /var/svn/web_project/conf/passwd user14
298 htpasswd /var/svn/web_project/conf/passwd user15
5.权限控制
/var/svn/web_project/conf/authz
[groups] #建立群组
admins = user1,user2,user3
[/] #表示启动的根目当
@admins = rw
* = r
6.启动http+svnserve
/bin/systemctl start httpd.service
svnserve -d -r /var/svn 所有/var/svn项目版本库都生效
ps -ef|grep svn
lsof -i:3690
转载请注明:谷谷点程序 » linux下安装svn的方法