svn 服务器在生产环境中的搭建

简介:

                           svn 服务器在生产环境中的搭建    


搭建环境 

阿里云服务器  CentOS release 6.7


安装软件 

yum install subversion  -y  


创建项目目录 

cd /home/svnuser/svn 


svnadmin create test1   #创建项目目录 


查看配置配置文件  


ls /home/svnuser/svn/test1 


conf  db  format  hooks  locks  README.txt  


配置文件解释 

conf #存放版本库所用配置文件的目录


db #版本数据存储目录


format # 存储一个整数的文件,此整数代表库层次结构版本


hooks #  存放版本库勾子目录


locks # 存储库锁目录,用来跟踪库的访问者


修改配置文件    (多个目录的话实现统一认证)


ls /home/svnuser/svn/test1/conf


authz  passwd  svnserve.conf  


vim svnserve.conf    修改配置文件

[general]

### These options control access to the repository for unauthenticated

### and authenticated users.  Valid values are "write", "read",

### and "none".  The sample settings below are the defaults.

anon-access = none   #  不允许匿名访问   

auth-access = write  #  允许写的权限

### The password-db option controls the location of the password

### database file.  Unless you specify a path starting with a /,

### the file's location is relative to the directory containing

### this configuration file.

### If SASL is enabled (see below), this file will NOT be used.

### Uncomment the line below to use the default password file.

password-db = passwd  # 密码认证

### The authz-db option controls the location of the authorization

### rules for path-based access control.  Unless you specify a path

### starting with a /, the file's location is relative to the the

### directory containing this file.  If you don't specify an

### authz-db, no path-based access control is done.

### Uncomment the line below to use the default authorization file.

authz-db = authz   #  用户权限配置

### This option specifies the authentication realm of the repository.

### If two repositories have the same authentication realm, they should

### have the same password database, and vice versa.  The default realm

### is repository's uuid.

# realm = My First Repository

 

vim  authz  修改权限配置文件 


[groups]   #定义组

test1=zhangyi   定义组中的用户

test2=zhanger

# [/foo/bar]

# harry = rw

# &joe = r

# * =


[/]      //制定根目录下的权限

@test1 = rw

* = r          //其他用户只有读权限


[svn/test:/]   #定义目录,从启动目录下面的下一级目录开始写

@test1 = rw

* =r  其他用户只有读的权限


vim passwd #定义用户的密码

[users]

# harry = harryssecret

# sally = sallyssecret

zhangyi = test1


启动服务 

svnserve -d -r /home/svnuser/ 


查看是否启动成功 


[root@iZ28zk3a6Z svn]# netstat -anutp | grep 369

tcp        0      0 0.0.0.0:3690                0.0.0.0:*                   LISTEN      2501/svnserve


设置开机自启动 

vim /etc/rc.local 

#!/bin/sh

#

# 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

添加下面一行

svnserve -d -r /home/svnuser/  


客户端访问

下载客户端tortoiseSVN

打开资源库浏览器输入地址, svn://你的svn服务器ip:svn/test/


如遇到报错问题 


Unable to connect to a repository at URL 'svn://ip/svn/test


需要清除下缓存 

TortoiseSVN -> Settings -> Saved Data

点击个个“Clear”按钮,把本地缓存都清除了,点击“确定”;




本文转自 水滴石川1 51CTO博客,原文链接:http://blog.51cto.com/sdsca/1772980,如需转载请自行联系原作者

相关文章
|
1月前
|
存储 网络协议 Ubuntu
Linux环境下的SVN服务器搭建并结合内网穿透实现远程连接
Linux环境下的SVN服务器搭建并结合内网穿透实现远程连接
|
3月前
|
Ubuntu 安全 网络安全
百度搜索:蓝易云【Ubuntu系统SVN服务器搭建教程】
现在,你已经成功在Ubuntu系统上搭建了SVN服务器。其他用户可以通过SVN客户端连接到你的SVN服务器,进行代码版本管理和协作开发。注意,为了安全起见,建议配置SSL加密以保护数据传输。
39 1
|
3月前
|
Apache 项目管理 数据安全/隐私保护
【cpolar】TortoiseSVN如何安装并实现公网提交文件到本地SVN服务器
【cpolar】TortoiseSVN如何安装并实现公网提交文件到本地SVN服务器
46 0
|
1月前
|
网络协议 Ubuntu Linux
如何在Linux环境搭建本地SVN服务器并结合cpolar实现公网访问
如何在Linux环境搭建本地SVN服务器并结合cpolar实现公网访问
|
2月前
|
存储 网络协议 Ubuntu
Linux环境下SVN服务器的搭建与公网访问:使用cpolar端口映射的实现方法
由于文档资料越来越多,将所有资料都存放在自己的电脑上容易混淆,并且也不利于分享。这种情况下,考虑将资料上传SVN统一管理,这样一来其他人也能很方便的查略各种资料。
|
4月前
|
算法 程序员 Apache
Windows下搭建SVN服务器并配置eclipse和idea
Windows下搭建SVN服务器并配置eclipse和idea
53 1
|
4月前
|
网络安全 数据安全/隐私保护
Centos8下快速搭建SVN服务器
Centos8下快速搭建SVN服务器
89 0
|
7月前
|
IDE Linux 开发工具
从旧服务器迁移svn到另一台新服务器中(linux系统)|遇到诸多坑,已解决
从旧服务器迁移svn到另一台新服务器中(linux系统)|遇到诸多坑,已解决
|
Linux Shell 数据安全/隐私保护
CentOS 搭建SVN服务器
CentOS 搭建SVN服务器
410 0
CentOS 搭建SVN服务器
|
4月前
|
小程序 Linux Shell
SVN配置服务器自动更新
使用svn做版本控制服务器,其实还是比较方便的,不管是从搭建还是配置上,相对于git,都要简单很多。 Linux如何搭建SVN服务器,请移步《Centos7安装SVN》
49 0