centos6.0 配置SVN
基本步骤: 1、安装必需的subversion 2、创建版本库 3、配置用户和权限 4、钩子和svn常用命令说明
一、安装subversion 在这里我们使用yum来安装subversion,使用以下命令即可完成。
[root@localhost ~]# yum -y install subversion
二、创建版本库
[root@localhost ~]# mkdir -p /home/svn/project01
[root@localhost ~]# svnadmin create /home/svn/project01
三、版本库管理配置 进行刚才创建的版本库目录下的conf目录,可以看到有三个文件。
[root@localhost ~]# cd /home/svn/project01/conf
[root@localhost conf]# ls
authz passwd svnserve.conf
svnserve.conf 这个是版本库的配置文件 passwd 这个是记录用户帐号密码的文件 authz 这个则是记录组、权限和身份验证的文件 1、配置svnserve.conf文件 这里需要设置以下几处 anon-access = none 指定匿名权限,默认为可读,现设置匿名无权限 auth-access = write 用户有写权限 password-db = passwd 账号密码文件的路径,psswd文件也可复制一份,命名为 passwd.conf 这样可以知道是配置文件,也可以放到其它目录下 authz-db = authz 同上 注意去掉#注释以后配置一定要顶格写,下同。
[root@localhost conf]# vi svnserve.conf
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
2、配置passwd 该文件中记录svn用户名密码,以 (帐号 = 密码)或 (帐号 : 密码)的形式进行储存。 多用户之前用换行区分。这里配置了一个用户名为test1密码为123456的svn 账户。
[root@localhost conf]# vi passwd
### This file is an example password file for svnserve.
### Its format is similar to that of svnserve.conf. As shown in the
### example below it contains one section labelled [users].
### The name and password for each user follow, one account per line. [users]
# harry = harryssecret
# sally = sallyssecret
test1 = 123456
3、authz文件的配置 [groups]表用于用户组的配置例如 “developers = test1,test2”这样就将这2个用户方在了developers组织之中。 建立组是为了方便给一组相同权限的用户分配权限。 [/] 指定是svn的根版本库 版本库目录格式: [<版本库>:/项目/目录] @<用户组名> = <权限> <用户名> = <权限>
[root@localhost conf]# vi authz [groups]
# harry_and_sally = harry,sally
# developers = test1, test2 # [/foo/bar]
# harry = rw
# * = # [repository:/baz/fuz]
# @harry_and_sally = rw
# * = r
[/]
test1 = rw
* =
这样svn版本库就算配置完成了。
运行 svn, (停止SVN服务器命令为:killall svnserve )
[root@localhost ~]# svnserve -d -r /home/svn/
我们继续说下其他常用的一些配置 1、开机自动运行 在/etc/rc.d/rc.local 添加 “/usr/bin/svnserve -d -r svn版本库目录” 即可
[root@localhost ~]# vi /etc/rc.d/rc.local #
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff. touch /var/lock/subsys/local
/usr/bin/svnserve -d -r /home/svn/
2、钩子自动更新 说明,在开发时经常需要提交代码,如果使用钩子自动更新的话,只要有人提交后就能自动更新到服务器上,非常方便哦。 首先必须对代码目录checkout
[root@localhost ~]# cd /var/www
[root@localhost www]# svn checkout svn://192.168.1.100/project01
Authentication realm: 21d46c22-96a8-465b-9d0b-58a1e04abdfd
Password for 'root':
Authentication realm: 21d46c22-96a8-465b-9d0b-58a1e04abdfd
Username: test1
Password for 'test1':
Checked out revision 0.
这样在 /var/www/ 中会生成一个目录 project01,我们可以把这个目录设置成站点来访问。
进入版本库hooks目录 将post-commit.tmpl 模板复制一份 取名post-commit 在末尾加上 svn up /home/svn/project01/ –username test1 –password 123456 并赋予执行权限。
[root@localhost ~]# cd /home/svn/project01/hooks/
[root@localhost hooks]# ls
post-commit.tmpl post-revprop-change.tmpl pre-commit.tmpl pre-revprop-change.tmpl start-commit.tmpl
post-lock.tmpl post-unlock.tmpl pre-lock.tmpl pre-unlock.tmpl
[root@localhost hooks]# cp post-commit.tmpl post-commit
[root@localhost hooks]# vim post-commit REPOS="$1"
REV="$2" svn up /home/svn/project01/ --username test1 --password 123456 [root@localhost hooks]# chmod +x post-commit
这样当用户提交文件的第时候,svn将会自动执行更新,使代码同步。
centos6.0 配置SVN的更多相关文章
- CentOS-6.*安装配置SVN
安装说明 系统环境:CentOS-6.3 安装方式:yum install (源码安装容易产生版本兼容的问题) 安装软件:系统自动下载SVN软件 检查已安装版本 #检查是否安装了低版本的SVN [ro ...
- CentOS6.3配置SVN之subversion1.7.7
今天配置了 SVN 记在这儿 备忘: 1. 下载 svn 软件包和依赖包 cd /mydata/soft wget http://labs.mop.com/apache-mirror/subversi ...
- Centos6.8配置svn
svn的安装:yum -y install subversion 一.一个仓库放所有的项目 创建仓库,以后所有代码都放在这个下面,创建成功后在svn下面多了几个文件夹.1.创建仓库:svnadmin ...
- 在CentOS6.0上安装Oracle 11gR2 (11.2.0.1)以及基本的配置(一)
首先安装CentOS6.0 就不用说了.安装即可.唯一需要注意的就是后面Oracle 11G Installation guide中的Checking the Software Requireme ...
- centOS6.0虚拟机ip配置
1.首先使用虚拟机安装好centOS6.0系统 2.虚拟机网络配置:(选择桥接模式) 3. 第一步:首先关闭防火墙 1.将防火服务从启动列表移除 #chkconfig --del iptables # ...
- CentOS6.9快速安装配置svn
CentOS6.9快速安装配置svn 环境介绍: 操作系统:CentOS release 6.9 (Final)192.168.65.130 (svn服务器)192.168.65.129 (svn客户 ...
- CentOs 6.6 安装配置 SVN
① 挂载光盘 mount /dev/cdrom /mnt/cdrom ② yum 安装 svn yum -y install subversion ③ 创建svn 版本库根目录 mkdir -p /w ...
- aliyun CentOS6.5 上 svn 安装笔记
为了方便管理自己的一些学习资料.总结等,在CentOS6.5上安装SVN,记录过程如下: 1.1 安装方式 独立服务器 fsfs SVN服务器有2种运行方式:独立安装.SVN+Apache.独立 ...
- Centos/ubuntu配置SVN服务
Centos安装svn yum -y install subversion ubuntu安装svn apt-get install subversion Centos配置svn root@hello: ...
随机推荐
- angularjs1-7,供应商
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...
- ActiveX插件
C#制作ActiveX插件 首先新建项目--->类库,取名:ActiveXDemo 右键项目属性:应用属性==>程序集信息=>使程序集Com可见, 生成==>输出==>为 ...
- [POI 2007] 旅游景点
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=1097 [算法] 首先,用Dijkstra算法求出2-k+1到每个点的最短路 然后,我 ...
- POJ 1466 最大独立点集
思路:匈牙利 n-ans/2; // by SiriusRen #include <cstdio> #include <cstring> #define N 505 using ...
- pyspider architecture--官方文档
原文地址:http://docs.pyspider.org/en/latest/Architecture/ Architecture This document describes the reaso ...
- SQL Server 查询所有包含某文本的存储过程、视图、函数
• 方法一:查询所有包含某文本的存储过程.视图.函数 SELECT * from sysobjects o, syscomments s where o.id = s.id AND text LIK ...
- line-height与间距总总
一点说明(个人吐槽,可以略过) 之所以想写这篇文章,是因为自己工作的经验总结.以前的页面编写极度不注重间距大小,特别是行级元素间距.认为只要差不多好就行了,没必要花那么大的精力去抠几px的小细节.事实 ...
- mobiscroll插件的基本使用方法
前一阵子接触到了mobiscroll插件,用在移动端的日期选择上,感觉倍棒,于是便敲了一个小案例,与大家一起分享分享 <!DOCTYPE html> <html lang=" ...
- SQL学习——基础语句(4)
前面感觉真的好乱,想哪,写哪.这里慢慢整理…… SQL Having 语句 还是前面的那两个表: grade表: student表: 我们需要查找这里的s_id下的gradeValue的和,这就要分组 ...
- C#实现软件监控外部程序运行状态的方法
本文实例讲述了C#实现软件监控外部程序运行状态的方法.分享给大家供大家参考.具体方法如下: 需要外挂一个程序,用于监控另一个程序运行状态,一旦检测到另一程序关闭,就触发一个事件做其他处理. using ...