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: ...
随机推荐
- UVA - 1642 Magical GCD 数学
Magical GCD The Magical GCD of a nonempty sequence of positive integer ...
- redis.conf 配置项说明
redis.conf 配置项说明如下: Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程 daemonize no 当Redis以守护进程方式运行时,Redis ...
- 英语发音规则---P字母
英语发音规则---P字母 一.总结 一句话总结: 1.P发[p]音? paper ['peɪpə] n. 纸 plane [pleɪn] n. 飞机 pig [pɪg] n. 猪 ship [ʃɪp] ...
- Java中Array、List、Set、Map
一.Java中数组 数组用来存放固定数量的同类元素,声明方法: T[] ref,T ref[],如int[] intAry; int intAry[].推荐用T[]的方式,后一种方式为兼容C++习惯写 ...
- NEU 1040 Count
1040: Count 时间限制: 1 Sec 内存限制: 128 MB提交: 59 解决: 23[提交][状态][讨论版] 题目描述 Many ACM team name may be very ...
- DB-MySQL:MySQL GROUP BY
ylbtech-DB-MySQL:MySQL GROUP BY 1.返回顶部 1. MySQL GROUP BY 语句 GROUP BY 语句根据一个或多个列对结果集进行分组. 在分组的列上我们可以使 ...
- 17. Letter Combinations of a Phone Number[M]电话号码的字母组合
题目 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that ...
- Oracle学习系类篇(一)
1.表空间介绍 oarcle数据库真正存放数据的是数据文件(data files),Oarcle表空间(tablespaces)实际上是一个逻辑的概念,他在物理上是并不存在的,那么把一组data fi ...
- IE8不支持响应式设计解决方法
下载并引入 respond.js 即可 为了针对IE8应用这段脚本,需要针对IE8的条件注释 <!--[if lt IE 9]> --- <! [endif]--> 为了不让并 ...
- DataReader相关知识点
C#中提供的DataReader可以从数据库中每次提取一条数据. 1. 获取数据的方式[1]DataReader 为在线操作数据, DataReader会一直占用SqlConnection连接,在其获 ...