svn + apache server version control structures

Centos7 (linux) build a version control server (svn + apache)

1. Introduction:
version control server:
Version Control (Revision control) is a software engineering skills, membership in the development process to ensure that the same file being edited by a different person have been updated.
SVN:
SVN (Subversion) is a version management tool, CVS successor. Currently, the vast majority of open source software use svn as code version management software.
As the operation and maintenance staff, installation and configuration of SVN server and the client is necessary to master the content.
Common version control:
Cvs of the: Because cvs coding problem before, and now most software development companies use SVN instead of the cvs
Svn: centralized version control
Git: distributed version control
2.SVN server operating modes:
Mode 1: SVN server is running alone, listening port: 3690, access methods: SVN: // ip
mode 2: SVN server + Apache, listening port: 80, access methods: HTTP: // ip
3. installation:
installation SVN server and Apache, mod_dav_svn module
mod_dav_svn module: apache http server plug-in that lets repository via http protocol, to show on the site
Yum install -y subversion httpd mod_dav_svn

to create a repository: mkdir / var / repos
project repository: svnadmin create / var / repos / mingdeng3000 ( warehouse name taken lightly)
svnadmin create / var / repos / nike (create warehouse mingdeng3000 and nike)

 

 

 

svn comes with user rights profiles: in / var / repos / mingdeng3000 / conf of authz, passwd, svnserve.conf file
(because we use the apache, we do not have built-svn)
4. Start SVN:
svnserve -d - r / var / repos / (-d , to specify svn running in the background; -r, or the root directory specified svn repository)
to see if the start: Ps aux | grep svn; netstat -atnpu | grep 3690;

5.查看Apache支持subversion的两个动态库有没有安装成功。
一般默认在/usr/lib64/httpd/modules下,有没有mod_dav_svn.so和mod_authz_svn.so模块
6.配置Apache通过mod_dav_svn模块访问到svn服务器。
编辑:Vim /etc/httpd/conf.d/subversion.conf(手写,默认7不存在,6存在此文件)(让apache支持svn)
写入的内容:
<Location /svn> #####注释####apache的虚拟目录,后面通过http://192.68.27.101/svn来访问mingdeng3000这个仓库
DAV svn
SVNParentPath /var/repos ###注释####存放我这mingdeng3000这个库的根目录
AuthType Basic
AuthName "SVN server of mingdeng3000! ###注释###apache认证时弹出的消息
AuthUserFile /home/svn/passwd #####注释####passwd文件存储用户名和密码
AuthzSVNAccessFile /home/svn/auth###注释###存放用户的权限
Require valid-user
</Location>

 

 

 

7.建立本地访问控制文件/home/svn/passwd,后期通过httpd服务器访问svn时,会使用这个文件中的用户信息验证用户和密码
mkdir /home/svn
htpasswd -c /home/svn/passwd mingdeng,用户:mingdeng密码123.123
htpasswd /home/svn/passwd john ,用户nike,密码321.321
8.创建用户权限管理文件:
vim /home/svn/auth
[/] #####注释####项目仓库根目录下,有2个仓库,mingdeng都有读写权限
mingdeng=rw
[nike:/] ########注释#####nike仓库目录下,用户john只对nike有读写权限
john=rw

 

 

 

修改版本库权限
Chown -R apache:apache /var/repos或者 chmod 777 /var/repos
9.启动apache:
systemctl start httpd.service
10.访问svn:
浏览器:http://ip/svn/仓库名
输入账号密码就行
第一次访问会显示版本0,因为没文件

 

 

 

11.下载并安装svn的Windows客户端:
http://tortoisesvn.net/about.zh.html 操作系统多少位就下载多少位的,安装完后,一定要重启电脑(先关闭虚拟机)
安装好后,新建一个文件夹svnclient,里面鼠标右键点击svn checkout,自动同步服务器svn

 

 

12.验证svn:

Windows客户端:拷贝几个文件到新建文件夹svn,没上传时文件上有“?”号标识符,右键点击svn commit上传文件到想去的库。
上传后黑色?就变成绿色对勾了。版本从0变为1了。
Linux客户端: svn checkout http://192.168.80.240/svn/mingdeng3000/
先输入当前Linux登录密码(我这是root),再输入svn账号密码。
登录完后,会自动下载仓库的文件,保存到当前路径下自动生成mingdeng3000/文件夹里(仓库nike同理)

Guess you like

Origin www.cnblogs.com/mingdeng3000/p/12005702.html