CentOS 创建SVN 服务器,并且自动同步到WEB 目录

CentOS 创建SVN 服务器,并且自动同步到WEB 目录

标签: centossvnsubversion服务器
 分类:
linux(5) 
一、安装Subversion
#yum install subversion

 

二,基本的SVN服务器配置
1,新建一个目录用于存储SVN所有文件
# mkdir /home/svn

2,新建一个版本仓库
# svnadmin create /home/svn/project

3,初始化版本仓库中的目录
# mkdir project project/server project/client project/test (建立临时目录)
# svn import project/ file:///home/svn/project -m “初始化SVN目录”
# rm -rf project (删除临时建立的目录)

4,添加用户
要添加SVN用户非常简单,只需在/home/svn/project/conf/passwd文件添加一个形如“username=password”的条目就可以了。为了测试,我添加了如下内容:

[users]
# harry = harryssecret
# sally = sallyssecret
pm = pm_pw
server_group = server_pw
client_group = client_pw
test_group = test_pw

5,修改用户访问策略
/home/svn/project/conf/authz记录用户的访问策略,以下是参考:

[groups]
project_p = pm
project_s = server1,server2,server3
project_c = client1,client2,client3
project_t = test1,test1,test1

[project:/]
@project_p = rw
* =

[project:/server]
@project_p = rw
@project_s = rw
* =

[project:/client]
@project_p = rw
@project_c = rw
* =

[project:/doc]
@project_p = rw
@project_s = r
@project_c = r
@project_t = r
* =

说明:以上信息表示,只有project_p用户组有根目录的读写权。r表示对该目录有读权限,w表示对该目录有写权限,rw表示对该目录有读写权限。最后一行的* =表示,除了上面设置了权限的用户组之外,其他任何人都被禁止访问本目录。这个很重要,一定要加上!

6,修改svnserve.conf文件,让用户和策略配置升效.
svnserve.conf内容如下:

[general]
anon-access = none
auth-access = write
password-db = /home/svn/project/conf/passwd
authz-db = /home/svn/project/conf/authz

7,启动服务器
# svnserve -d -r /home/svn
注意:如果修改了svn配置,需要重启svn服务,步骤如下:


 

注意:配置项所有的行都必须顶格,否则报错。

 

 

# ps -aux|grep svnserve
# kill -9 ID号
# svnserve -d -r /home/svn

8,测试服务器

# svn co svn://192.168.60.10/project
Authentication realm: <svn://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Password for 'root':
Authentication realm: <svn://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Username: server_group
Password for 'server_group':
svn: Authorization failed ( server_group没用根目录的访问权 )

# svn co svn://192.168.60.10/project
Authentication realm: <svn://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Password for ‘root’:
Authentication realm: <svn://192.168.60.10:3690> 92731041-2dae-4c23-97fd-9e1ed7f0d18d
Username: pm
Password for ‘pm’:
A    project/test
A    project/server
A    project/client
Checked out revision 1.  ( 测试提取成功 )

# cd project/server
# vim main.c
# svn add main.c
# svn commit main.c -m “测试一下我的C程序,看什么看,不行啊??”
Adding         main.c
Transmitting file data .
Committed revision 2.  ( 测试提交成功 )

 

 

三.自动同步

现在是关键的一步,我们需要使我门的测试服务器127.0.0.1进行同步更新:
在/home/svn/project/hooks/目录下建立post-commit文件

 

#cd /home/svn/project/hooks#vi post-commit内容如下:#!/bin/sh
#设定环境变量,如果没有设定可能会出现update报错
export LANG=zh_CN.GBK   
#设定语言,根据系统语言设置,如果是UTF-8 就设置为 LANG=zh_CN.UTF-8
SVN_PATH=/usr/bin/svn
WEB_PATH=/home/wwwroot/testsvn$SVN_PATH update svn://127.0.0.1/project $WEB_PATH  --username 用户名 --password 密码 --no-auth-cache

 

 

保存退出

 

给post-commit 执行权限:

chmod -R 755 post-commit

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/543790.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

TTYL的完整形式是什么?

TTYL&#xff1a;稍后再与您交谈 (TTYL: Talk To You Later) TTYL is an abbreviation of Talk To You Later. It is an internet slang that is most generally used in text messaging, instant messaging, and chatting on Facebook, Twitter, WhatsApp, etc. The acronym i…

zhilizhili-ui 2016始动 开始做个样例站吧 (一)

对 我又挖坑了 不过其实也不算挖坑 因为ui构建中就会有填坑的文章 之前一直在写《编写大型web页面 结合现有前端形势思考未来前端》这是一篇巨难写的文章 估计要到年中才能写好了 写作的过程中 发生了国内前端大撕逼 2015的尾声大战 是否可以宣告前端是否开始新的时代 2016年 国…

python 网格_Python | 网格到情节

python 网格Most of the time, we need good accuracy in data visualization and a normal plot can be ambiguous. So, it is better to use a grid that allows us to locate the approximate value near the points in the plot. It helps in reducing the ambiguity and t…

2016年1月计划

开始试着每月做计划和总结&#xff0c;有节奏的规划自己的时间&#xff0c;一月计划&#xff1a; 1、hive那本书拖了很久了&#xff0c;一月一定会看完。 2、因为跟着阚爷的风准备试着做一下讲师&#xff0c;分配给我的是推荐这块&#xff0c;所以网上多找找做推荐的资源&#…

slr1文法_SLR的完整形式是什么?

slr1文法单反&#xff1a;单镜头反光 (SLR: Single Lens Reflex) SLR is an abbreviation of Single Lens Reflex. It is used in high standard cameras. SLR makes use of an automatic moving mirror arrangement that makes it possible for photographers to perceive pre…

vim快捷键2

一、移动光标 1、左移h、右移l、下移j、上移k 2、向下翻页ctrl f&#xff0c;向上翻页ctrl b 3、向下翻半页ctrl d&#xff0c;向上翻半页ctrl u 4、移动到行尾$&#xff0c;移动到行首0&#xff08;数字&#xff09;&#xff0c;移动到行首第一个字符处^ 5、移动光标到下一…

FYR的完整形式是什么?

财政年度&#xff1a;供您参考 (FYR: For Your Reference) FYR is an abbreviation of "For Your Reference". FYR是“供您参考”的缩写。 It is an expression, which is commonly used in the Gmail platform. It is written as a follow-up message for the info…

UIScrollView的简单使用

- UIScrollView 介绍 问&1.UIScrollView 是干什么的? • UIScrollView 也是一种控件&#xff0c;继承自UIView。• 用来实现”滚动”和”缩放”的控件 什么是UIScrollView? UIScrollView是一个能够滚动的视图控件&#xff0c;可以用来展示大量的内容&#xf…

什么是苹果耳塞?

苹果耳塞 (Apple Earbuds) Apple Earbuds are another sound device made by Apple on 23rd October 2001. It is an in-ear sound device and it has been included in all the mobile and music devices of Apple. Apple Earbuds are quite comfortable and easy to handle w…

趣说游戏AI开发:对状态机的褒扬和批判

0x00 前言 因为临近年关工作繁忙&#xff0c;已经有一段时间没有更新博客了。到了元旦终于有时间来写点东西&#xff0c;既是积累也是分享。如题目所示&#xff0c;本文要来聊一聊在游戏开发中经常会涉及到的话题——游戏AI。设计游戏AI的目标之一是要找到一种便于使用并容易拓…

类中函数模板 typeof_Julia中的typeof()函数

类中函数模板 typeofJulia| typeof()函数 (Julia | typeof() function) typeof() function is a library function in Julia programming language, it is used to get the concrete type of the given value or variable. typeof()函数是Julia编程语言中的库函数&#xff0c;…

sencha touch调试时Please close other application using ADB: Monitor, DDMS, Eclipse

1、运行——cmd—— netstat -aon|findstr "5037" 2、打开任务管理器&#xff0c;查看所有进程 显示进程pid&#xff08;文件-查看&#xff09;--查找pid7740的结束。转载于:https://www.cnblogs.com/taoshengyujiu/p/5099588.html

定时器mia是什么意思_MIA的完整形式是什么?

定时器mia是什么意思MIA&#xff1a;行动失踪 (MIA: Missing In Action) MIA is an abbreviation of "Missing In Action". MIA是“缺少行动”的缩写。 It is an expression, which is commonly used in the Gmail platform. It is written to show that the origin…

window下自己主动备份数据库成dmp格式的bat写法

复制以下的命令到一个txt文本文档&#xff0c;然后改动相应的參数为自己须要的參数&#xff0c;一切完毕之后&#xff0c;将文件保存为bat格式。这样每次须要备份的时候仅仅须要双击一下这个bat文件。其它的都不用你了&#xff0c;你仅仅须要静静的等待……</pre><pre…

l和l_L&T的完整形式是什么?

l和&lL&#xff06;T&#xff1a;Larsen和Toubro (L&T: Larsen and Toubro) L&T is an abbreviation of Larsen and Toubro. It is an Indian multinational conglomerate corporation with international networks and operations. It is dynamically engaged in …

例题 3-5 生成元 digit generator

1 #include<stdio.h>2 #include<string.h>3 #define maxn 1000054 int ans[maxn]; //类似于 比较大的数组还是开导外面比较好一点,防止报错.5 int main()6 {7 int x,y,m,T,n;8 memset(ans,0,sizeof(ans)); //数组归零.9 for(m1;m<maxn;m…

CRT的完整形式是什么?

CRT&#xff1a;阴极射线管 (CRT: Cathode Ray Tube) CRT is an abbreviation of Cathode Ray Tube. Cathode Ray Tube is a vacuum tube that accommodates one or more than one electron filled guns and a phosphorescent screen, which is used in television and convent…

Python打包程序

到py2exe的官网下载程序&#xff0c;注意对应的python版本&#xff0c;比如所用的python版本为2.7&#xff0c;那么就下载适配2.7版本的py2exe软件下载完成后安装&#xff08;与普通软件安装方式相同&#xff09; 2将要转换的python脚本放到Python文件夹内 在python的目录下面&…

ruby中!!_Ruby反向! 功能

ruby中!!逆转&#xff01; Ruby中的功能 (reverse! function in Ruby) As the name suggests, reverse! function is used to reverse the elements of an array. Most of the times, we need to reverse an array but if we do it with the help of loops, the program will b…

mcal rtm_RTM的完整形式是什么?

mcal rtmRTM&#xff1a;阅读手册 (RTM: Read The Manual) RTM is an abbreviation of "Read The Manual". RTM是“阅读本手册”的缩写 。 It is an expression, which is commonly used in messaging or chatting on social media networking sites like Facebook,…