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: ...
随机推荐
- [MySQL] 按年度、季度、月度、周、日统计查询
该死的mysql没有提供unix时间戳的专门处理函数,所以,如果遇到时间分组,而你用的又是整型unix时间戳,则只有转化为mysql的其他日期类型! FROM_UNIXTIM()将unix时间戳转 ...
- SQL 数据库性能优化
http://blog.csdn.net/yzllz001/article/details/54848513 1. 减少数据访问(减少磁盘访问) 2. 返回更少数据(减少网络传输或磁盘访问) 3. ...
- 淘宝druid报错:javax.management.InstanceNotFoundException: com.alibaba.druid:type=DruidDataSourceStat
问题: 启动tomcat报错: Tomat报出一下异常:ERROR [com.alibaba.druid.stat.DruidDataSourceStatManager] – unregister m ...
- 理解z-index和css中的层叠顺序问题(大神技术博的读后感?)
一直对 z-index不太理解,今天看到了大神的博客...http://www.zhangxinxu.com/wordpress/tag/z-index/ 1.层叠上下文:是一个名词!是一个性质!此时 ...
- uva 11624 Fire! 【 BFS 】
按白书上说的,先用一次bfs,求出每个点起火的时间 再bfs一次求出是否能够走出迷宫 #include<cstdio> #include<cstring> #include&l ...
- 如何打开DOS控制台及常见DOS命令作用
如何打开DOS控制台? * A:xp下如何打开DOS控制台? * a:开始--程序--附件--命令提示符 * b:开始--运行--cmd--回车 * c:win+r--cmd- ...
- [AtCoder Regular Contest 083] Bichrome Tree
树形DP. 每个点有两个属性:黑色点的权值和,白色点权值和,一个知道另一个也一定知道. 因为只要子树的和它相等的点得权值和不超过x[u],u点的权值总能将其补齐. 设计状态f[u]表示以u为根的子树, ...
- 使用iframe标签时如何通过jquery隐藏滚动条
通过mouseover和mouseout事件来控制iframe的滚动条 代码如下:
- 关于一些运算(&(与运算)、|(或运算)、^(异或运算)........)的本质理解【转】
看到一篇博客,关于一些运算的解析,觉得有用,怕以后找不着,直接复制下来,以备以后学习用 原文链接:https://blog.csdn.net/xiaopihaierletian/article/det ...
- 【henuacm2016级暑期训练-动态规划专题 B】Coloring Trees
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] f[i][j][k]前i个位置,第i个位置放j这个颜色,然后形成了k个联通块的最小花费 分第i个位置有没有已经放颜色两种情况考虑. ...