1:安装svn

apt-get install subversion

2. 开启svn服务器

svnserve -d

检查是否开启:ps aux | grep svnserve

若出现如下内容:

wkr 6537 0.0 0.0 13784 956 ? Ss 16:18 0:00 svnserve -d
wkr 7593 0.0 0.0 5784 864 pts/0 S+ 21:57 0:00 grep –color=auto svnserve

表示服务已开启。(注意:一定要有第1行,只有第2行说明服务未启动)

停止svn服务:  killall svnserve

3. 建立仓库

svnadmin create /home/svnrepos
理论上,仓库可以建立在任何目录中。

注意:重启svnserve  执行 svnserve -d  -r /home

这样在eclipse客户端把工程导入svn的时候 url需要填写

svn://ip/svnrepos/project_name

如果启动的时候带如下参数:svnserve -d  -r  /home/svnrepos

客户端:svn://ip/project_name  这样子会报错。验证失败

4. 修改配置文件

编辑 svnserve.conf

vi /home/svnrepos/conf/svnserve.conf

把anon-access = read 改为 none,auth_access = write

password-db = passwd  authz-db = authz 的注释去掉,还有[general]的注释也要去掉(这个默认没有注释)。
注:当你去掉注释的时候,不要简单的把前面的#去掉,要把前面的空格一块去掉,不然在Eclipse中使用的时候会出现配置文件格式错误的问题。

注意:如果authz-db = authz 这个注释掉了,则不需要配置/home/svnrepos/conf/authz

5. 修改帐户文件

vi  /home/svnrepos/conf/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
user1 = pass1  # 输入你定义的用户名和密码,密码显然没有加密

6. 修改授权文件

gedit /home/svnrepos/conf/authz

修改或者输入下面2行:

[svnrepos:/]      ##格式为    版本库名称  + :/
user1 = rw

其中,repos1是仓库名称,user1是用户名,rw代表读写。

7.客户端连接
svn co svn://ip/oplinux
用户名密码:rsync

8.实现SVN与WEB同步,可以CO一个出来,也可以直接配在仓库中

 
1)设置WEB服务器根目录为/alidata/www/webroot
 
2)checkout一份SVN
 
svn co svn://localhost/alidata/www/svndata/myproject /alidata/www/webroot
修改权限为WEB用户
 
chown -R www:www /alidata/www/webroot/myproject
3)建立同步脚本
 
cd /alidata/www/svndata/oplinux/hooks/
cp post-commit.tmpl post-commit
编辑post-commit,在文件最后添加以下内容
 
export LANG=en_US.UTF-8
SVN=/usr/bin/svn
WEB=/alidata/www/webroot/
$SVN update $WEB –username myname –password myname
chown -R www:www $WEB
增加脚本执行权限
 
chmod +x post-commit
这样,我们上传svn后,生产站点就能立马显示出来了,自动化程度高了很多。

阿里云搭建SVN服务器的更多相关文章

  1. 阿里云搭建git服务器

    阿里云服务器环境: CentOS7.0 jdk1.8.0 jre1.8.0 RAM:1G SWAP:3G MEM:40G apache-tomcat 8.0 1.下载gitlab-ce 11.0 到本 ...

  2. 阿里云服务器配置 SVN 服务器与生产站点同步

    作为linux的门外汉,一直觊觎svn的方便性,在有台aliyun的情况下,一起来搞搞.   1.环境   阿里云 centos5.5   2.安装svn   yum -y install subve ...

  3. 阿里云 搭建Git服务器

    1. 服务端安装git, ssh, 客户端安装git sudo apt-get install git sudo apt-get install ssh 2. 服务单创建用户server sudo a ...

  4. 阿里云CentOS Linux服务器上搭建邮件服务器遇到的问题

    参考文章: 阿里云CentOS Linux服务器上用postfix搭建邮件服务器 Linux系统下邮件服务器的搭建(Postfix+Dovecot) 本来想自己搭建邮件服务器,但是看到一篇资料表示阿里 ...

  5. 转-阿里云CentOS Linux服务器上用postfix搭建邮件服务器

    http://www.cnblogs.com/dudu/archive/2012/12/12/linux-postfix-mailserver.html 注:本文的邮件服务器只用于发送邮件,也就是ST ...

  6. 在centos上搭建SVN服务器和MySQL

    ----------搭建MySQL--------------- 1.查看yum库中的mysql yum list | grep mysql //查看yum库中的mysql 2.选择需要的mysql进 ...

  7. ubuntu搭建svn服务器并htpp访问版本库并svn与web同步

    Ubuntu搭建SVN服务器多版本库 1  介绍   Subversion是一个自由,开源的版本控制系统,这个版本库就像一个普通的文件服务器,不同的是,它可以记录每一次文件和目录的修改情况.这样就可 ...

  8. Linux(CentOS)系统下搭建svn服务器

    由于GitHub的私有项目需要收费,gitlab对服务器的要求必须是4GB内存以上.对于一些个人的小型项目,想要免费的版本控制工具来管理自己的代码,又不想代码公开,无疑SVN是比较好的选择.windo ...

  9. 阿里云轻量服务器价格及轻量与ECS服务器区别比较

    https://yq.aliyun.com/articles/221647 摘要: 阿里云轻量应用服务器价格表及介绍,关于轻量应用服务器和ECS服务器的性能对比 阿里云轻量应用服务器是阿里云新推出的服 ...

随机推荐

  1. Python之多进程

    1.Pool的用法 #!/usr/bin/env python # -*- coding: utf-8 -*- ''' @author: Shiyu Huang @contact: huangsy13 ...

  2. 在 PL/SQL 块的哪部分可以对初始变量赋予新值? (选择1项)

    A.结尾部分 B.开头部分 C.执行部分 D.声明部分 解答:C

  3. Xenocode Postbuild 2010 for .NET 混淆工具的详细使用步骤【转】

    1,首先我们需要去下载这个工具去,我这里倒是有一个下载的网址,已经被破解了,而且有序列号 http://download.csdn.net/tag/Xenocode+Postbuild+2010+fo ...

  4. motion的移植和使用

    说明: motion主页:http://www.lavrsen.dk/foswiki/bin/view/Motion motion下载地址:http://sourceforge.net/project ...

  5. Erlang TCP Socket的接收进程的2种方案

    转自:http://blog.csdn.net/summerhust/article/details/8740973 一旦打开了一个使用TCP连接的套接字,它就始终保持打开状态,直至任何一方关闭它或因 ...

  6. scala 官方教程

    http://zh.scala-tour.com/#/expression-and-values scala

  7. ORACLE expdp/impdp导出实例

    服务器上以sys或system超级管理员登录. SQL>create directory expdp_dir as '/home/oracle/dmpdata';(dmpdata 需要建立.赋予 ...

  8. 【Deep learning】NLP

    http://www.tuicool.com/articles/EvaQJnJ http://cs224d.stanford.edu/syllabus.html

  9. Ubuntu 13.04 安装 Oracle11gR2

    #step 1: groupadd -g 2000 dbauseradd -g 2000 -m -s /bin/bash -u 2000 griduseradd -g 2000 -m -s /bin/ ...

  10. unity如何停止不用字符串方式开启协程的方法

    通常我们知道开启协程用StartCoroutine("Method"); 停止协程用StopCoroutine("Method"); 如果我们想要终止所有的协程 ...