Ubuntu 12.04搭建svn服务器【转】
这是一个比较老旧的话题,毕竟大家现在都使用Git(http://git-scm.com/),Git在分支、代码存储、冲突、速度方面的机制都更优秀。
那我们难道还有使用svn的场景?当然,比如对Git很陌生却要快速推进项目,再比如转换成本很高的场景。。。。总之技术上永远没有孰优孰劣,只是看使用的场景而已
进入正题,ssh服务器,切换到root用户,首先安装subversion:
然后创建svn目录:
然后创建项目目录,xxxx为我们假定的目录名:
cd /home/svn
chmod -R xxxx
然后就是初始化svn仓库:
现在在项目目录里面会生成一堆文件和文件夹,至此项目基本搭建完成,下面进行权限部分
我们设定常用的场景是这样的,没有认证的用户只能读,认证之后的用户可以读写,认证是通过密码进行,let’s go:
vim svnserver.conf
然后注释以下3行,注意,开头不能有空格存在
anon-access = read //没有验证的用户只能读
auth-access = write //验证的用户能够读写
password-db = passwd //密码数据是当前目录下的passwd文件
然后我们就开始添加密码了
vim passwd
然后以如下格式添加用户名和密码:
username = passwd
还差最后一步,就是启动svn服务器:
-d 表示svnserver以“守护”进程模式运行
-r 指定文件系统的根位置,这样客户端不用输入全路径,就可以访问版本库
如:svn://youip/xxxx,eg: svn://192.168.1.7/xxxx
然后就可以开始使用啦
http://dashu.me/ubuntu-12-04%E6%90%AD%E5%BB%BAsvn%E6%9C%8D%E5%8A%A1%E5%99%A8/
ubuntu@---:/home/git$ svnadmin create svnpro
ubuntu@---:/home/git$ cd svnpro/conf
ubuntu@---:/home/git/svnpro/conf$ vim svnerver.conf
ubuntu@---:/home/git/svnpro/conf$ ll
total
drwxrwxr-x ubuntu ubuntu Mar : ./
drwxrwxrwx root root Mar : ../
-rw-rw-r-- ubuntu ubuntu Mar : authz
-rw-rw-r-- ubuntu ubuntu Mar : passwd
-rw-rw-r-- ubuntu ubuntu Mar : svnserve.conf
ubuntu@---:/home/git/svnpro/conf$ vim svnerve.conf
ubuntu@---:/home/git/svnpro/conf$ vim svnserve.conf
ubuntu@---:/home/git/svnpro/conf$ vim passwd
ubuntu@---:/home/git/svnpro/conf$ svnserve -d -r /home/git
svnserve: E000098: Can't bind server socket: Address already in use
ubuntu@---:/home/git/svnpro/conf$ ps -A |grep svn
? :: svnserve
ubuntu@---:/home/git/svnpro/conf$ kill
ubuntu@---:/home/git/svnpro/conf$ svnserve -d -r /home/git
ubuntu@---:/home/git/svnpro/conf$ cd /tmp
ubuntu@---:/tmp$ ls
ubuntu@---:/tmp$ mkdir shit
ubuntu@---:/tmp$ cd shit
ubuntu@---:/tmp/shit$ svn checkout svn://10.4.8.71/svnpro
Checked out revision .
ubuntu@---:/tmp/shit$ netstat
drwxrwxr-x ubuntu ubuntu Mar : .svn/
ubuntu@---:/tmp/shit/svnpro$ svn diff
ubuntu@---:/tmp/shit/svnpro$ svn diff
ubuntu@---:/tmp/shit/svnpro$ ll
total
drwxrwxr-x ubuntu ubuntu Mar : ./
drwxrwxr-x ubuntu ubuntu Mar : ../
drwxrwxr-x ubuntu ubuntu Mar : .svn/
ubuntu@---:/tmp/shit/svnpro$ svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ sudo nano asdf
[sudo] password for ubuntu:
ubuntu@---:/tmp/shit/svnpro$ svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ svn commit -m 'asdf'
svn: E205005: The log message is a pathname (was -F intended?); use '--force-log ' to override
ubuntu@---:/tmp/shit/svnpro$ svn commit -m "asdf"
svn: E205005: The log message is a pathname (was -F intended?); use '--force-log ' to override
ubuntu@---:/tmp/shit/svnpro$ sudo svn commit -m "asdf"
svn: E205005: The log message is a pathname (was -F intended?); use '--force-log ' to override
ubuntu@---:/tmp/shit/svnpro$ svn ci
ubuntu@---:/tmp/shit/svnpro$ svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ svn commit
ubuntu@---:/tmp/shit/svnpro$ ls
asdf
ubuntu@---:/tmp/shit/svnpro$ sudo svm ci
sudo: svm: command not found
ubuntu@---:/tmp/shit/svnpro$ sudo svn ci
ubuntu@---:/tmp/shit/svnpro$ ls
asdf
ubuntu@---:/tmp/shit/svnpro$ sudo svn add*
Unknown command: 'add*'
Type 'svn help' for usage.
ubuntu@---:/tmp/shit/svnpro$ sudo svn add *
A asdf
ubuntu@---:/tmp/shit/svnpro$ sudo svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ sudo nano asdf
ubuntu@---:/tmp/shit/svnpro$ sudo svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ sudo svn ci Log message unchanged or not specified
(a)bort, (c)ontinue, (e)dit:
e Log message unchanged or not specified
(a)bort, (c)ontinue, (e)dit:
asdf update
ubuntu@---:/tmp/shit/svnpro$ sudo svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ sudo svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ sudo svn ci Log message unchanged or not specified
(a)bort, (c)ontinue, (e)dit:
c
Authentication realm: <svn://10.4.8.71:3690> e0df80d6-353a-43b9-beb9-f13a67ab16c 2
Password for 'root':
Authentication realm: <svn://10.4.8.71:3690> e0df80d6-353a-43b9-beb9-f13a67ab16c 2
Username: sj
Password for 'sj': -----------------------------------------------------------------------
ATTENTION! Your password for authentication realm: <svn://10.4.8.71:3690> e0df80d6-353a-43b9-beb9-f13a67ab16c2 can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details. You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/ubuntu/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no
Adding asdf
Transmitting file data .
Committed revision .
ubuntu@---:/tmp/shit/svnpro$ svn log
------------------------------------------------------------------------
ubuntu@---:/tmp/shit/svnpro$ svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ sudo nano asdf
ubuntu@---:/tmp/shit/svnpro$ sudo svn ci Log message unchanged or not specified
(a)bort, (c)ontinue, (e)dit:
e
Authentication realm: <svn://10.4.8.71:3690> e0df80d6-353a-43b9-beb9-f13a67ab16c 2
Password for 'sj': -----------------------------------------------------------------------
ATTENTION! Your password for authentication realm: <svn://10.4.8.71:3690> e0df80d6-353a-43b9-beb9-f13a67ab16c2 can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details. You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/ubuntu/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no
Sending asdf
Transmitting file data .
Committed revision .
ubuntu@---:/tmp/shit/svnpro$ svn log
------------------------------------------------------------------------
r1 | sj | -- :: + (Tue, Mar ) | line ------------------------------------------------------------------------
ubuntu@---:/tmp/shit/svnpro$ sudo nano asdf
ubuntu@---:/tmp/shit/svnpro$ sudo svn ci --username admin --password admin
-----------------------------------------------------------------------
ATTENTION! Your password for authentication realm: <svn://10.4.8.71:3690> e0df80d6-353a-43b9-beb9-f13a67ab16c2 can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details. You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/ubuntu/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no
Sending asdf
Transmitting file data .
Committed revision .
ubuntu@---:/tmp/shit/svnpro$ svn update
Updating '.':
At revision .
ubuntu@---:/tmp/shit/svnpro$ svn log
------------------------------------------------------------------------
r3 | admin | -- :: + (Tue, Mar ) | lines admin changed lot of things..... ------------------------------------------------------------------------
r2 | sj | -- :: + (Tue, Mar ) | lines i changed somthing!!! ------------------------------------------------------------------------
r1 | sj | -- :: + (Tue, Mar ) | line ------------------------------------------------------------------------
ubuntu@---:/tmp/shit/svnpro$ sudo nano helloword.c
ubuntu@---:/tmp/shit/svnpro$ sudo svn add helloword.c
A helloword.c
ubuntu@---:/tmp/shit/svnpro$ sudo svn ci
Authentication realm: <svn://10.4.8.71:3690> e0df80d6-353a-43b9-beb9-f13a67ab16c 2
Password for 'admin': -----------------------------------------------------------------------
ATTENTION! Your password for authentication realm: <svn://10.4.8.71:3690> e0df80d6-353a-43b9-beb9-f13a67ab16c2 can only be stored to disk unencrypted! You are advised to configure
your system so that Subversion can store passwords encrypted, if
possible. See the documentation for details. You can avoid future appearances of this warning by setting the value
of the 'store-plaintext-passwords' option to either 'yes' or 'no' in
'/home/ubuntu/.subversion/servers'.
-----------------------------------------------------------------------
Store password unencrypted (yes/no)? no
Adding helloword.c
Transmitting file data .
Committed revision .
Ubuntu 12.04搭建svn服务器【转】的更多相关文章
- Ubuntu 12.04 搭建TFTP服务器
吐槽先:在Ubuntu上搭建TFTP服务器,网上搜到一堆资料,可惜基本都是部分能用,至于哪些部分能用还要自己摸索着试出来,郁闷之情仅次于找不到任何资料…… ---------------------- ...
- Ubuntu 12.04搭建l2tp服务器记录。
1. 安装openswan apt-get install openswan 2.打开 /etc/ipsec.conf 文件,做如下配置: 其中,virtual_privat这里包含的网络地址允许配置 ...
- Ubuntu 12.04搭建MTK 6577 安卓开发环境
Ubuntu 12.04搭建 MTK 6577安卓开发环境 1. 下载并安装Vmware虚拟机: 2. 下载并在虚拟机上安装Ubuntu 12.04 iso 安装包:下载地址: ...
- ubuntu 18.04 搭建flask服务器(大合集,个人实操)
ubuntu 18.04 搭建flask服务器(大合集) Ubuntu python flask 服务器 本次使用的Ubuntu版本为:Ubuntu 18.04.5 LTS (GNU/Linux 4. ...
- Ubuntu 12.04 搭建Android开发环境
Ubuntu 12.04 搭建Android开发环境 2013/7/29 Linux环境下搭建Android开发环境 大部分开发人员可能都在Windows下做开发,可能是感觉在Windows下比较方便 ...
- Ubuntu 12.04 搭建 Eclipse Android 开发环境(转)
Ubuntu 12.04 搭建 Eclipse Android 开发环境 http://blog.sina.com.cn/s/blog_93dc666c0101b39p.html (2012-09-0 ...
- (转)ubuntu 12.04搭建Adobe Flash Media Server服务
破解版传送门:http://fms45.cuplayer.com/fms4download.html 福利:1462-5247-1705-7678-8379-5590 下载解压 cd进目录,./ins ...
- 烂泥:ubuntu 14.04搭建OpenVPN服务器
本文由秀依林枫提供友情赞助,首发于烂泥行天下 公司分部需要连接公司内部的服务器,但是该服务器只允许公司内部的网络访问. 为了解决这个问题,打算使用VPN.对于VPN以前使用最多的是PPTP这个解决方案 ...
- 【Ubuntu 18.04 搭建VNC服务器】
https://www.jianshu.com/p/f58fe5cdeb5f 桌面共享 Ubuntu 18.04自带桌面共享,可以将物理桌面共享给VNC.但是无法创建新的桌面. 具体参考 https: ...
随机推荐
- Python + winpcap抓包和发包
winpcapy Python的winpcapy库可以简单地实现收发Layer2层(数据链路层,以太网)数据. winpcapy主页:https://github.com/orweis/winpcap ...
- 第三章 Goroutine调度策略(16)
本文是<Go语言调度器源代码情景分析>系列的第16篇,也是第三章<Goroutine调度策略>的第1小节. 在调度器概述一节我们提到过,所谓的goroutine调度,是指程序代 ...
- Python中的变量,数据类型
Python中变量的命名规则:以字母和下划线开头,由字母,数字和下划线组成,区分大小写 Python中同样有加减乘除取余运算,还有一个运算符**,相当与幂运算,当然,幂运算的优先级要高于加减乘除 最后 ...
- 浅谈JavaScript--闭包
闭包的概念 由于在Javascript语言中,只有函数内部的子函数才能读取局部变量,因此可以把闭包简单理解成"定义在一个函数内部的函数". 变量的作用域 要理解闭包,首先必须理解J ...
- weex前端式写法解决方案---eros
前言 如果想用前端的方式写一个app怎么办呢? 如果你用的是 React,那么它已经有了一个比较完善的体系跟社区.如果你用的是Vue又不想花费太多时间去重新学习React,那么目前比较靠谱的方案就是w ...
- IIS中使用子目录文件作为默认文档(Default Document)替代重定向
以前一直以为IIS应用程序的默认文档只能设置根目录下的文件,像index.html,default.aspx等,后来经同事指点,原来子目录或者子应用程序下的文件也可以添加到根应用程序的默认文档列表中. ...
- Claris’ Contest # 2 Day 2 Problem C. Dash Speed(分治+可持久化并查集+树剖)
题面 题解 \(std\)爆栈了→_→ 我们先考虑一个简化的问题,如果只有加边的情况下如何动态维护直径 合并两棵树时,设\(a,b\)为\(A\)的直径的两个端点,\(c,d\)为\(B\)的直径的两 ...
- knockout+MVC+webapi+sqlserver完成增删查改
快过年了,公司的事情较少,想着开始学习点新东西.这段时间一个项目用到了mvc和webapi,然后一直对knockout比较感兴趣,就想着用这个框架做一个小实例.数据库采用的是sqlserver.话不多 ...
- centos 7 安装python3
centos系统默认已安装python2.7,python3需要手动安装.以上是安装步骤 一.备份原来的2.7版本 首先看一下默认的python2.7在哪里 [root@apple ~]# cd / ...
- 分别使用ES5和ES6进行数组去重以及注意事项
ES6,ES5数组去重 使用Es6进行数组去重 var arr = [false, true, undefined, null, NaN, 0, 1, {}, {}, 'a', 'a', NaN]; ...