centos7 install SVN

The first: based SVN + Apache + IF.svnadmin support https implement web management SVN:

1, a brief introduction:

iF.SVNAdmin applications are Web-based GUI Subversion your authorization file. It is based on PHP 5.3, you need to install a Web server (Apache). The application does not require any database back-end or Subversion authorization and user authentication file Similarly, it is fully based. (+ Includes support for LDAP users and groups)
2. Software preparation:

[root@localhost ~]#yum install wget unzip php httpd mod_dav_svn subversion -y

To see if the installation was successful:

[root@localhost ~]#httpd -version
[root@localhost ~]#svnserve --version
[root@localhost ~]#ls /etc/httpd/modules/ | grep svn

3, configuration apache:

[root@localhost ~]# vim /etc/httpd/conf.d/subversion.conf

. 1 the LoadModule dav_svn_module modules / mod_dav_svn.so
 2 the LoadModule authz_svn_module modules / mod_authz_svn.so.
 . 3 <the Location / the svn>
 . 4  the DAV the svn
 . 5  root #vn of SSLRequireSSL SSL access
 . 6 the SVNParentPath / var / WWW / the svn
 . 7  #basic authentication
 . 8  AuthType Basic
 . 9   # authentication information display             
 10 the AuthName  " the Authorization SVN " . 11 # & user file password
 12 is the AuthUserFile / var / WWW / the svn / the passwd
 13 is # access control file
 14 
 The AuthzSVNAccessFile / var / WWW / the svn / the authz
 15  # true user requirements, lack of anonymity
 16 the Require valid- User            
 . 17 </ the Location>

4, the establishment SVN Server repository:

# Create a directory to store warehouse 
[root @ localhost ~] # mkdir / var / the WWW / svn 
# Create a warehouse 
[root @ localhost ~] # svnadmin the Create / var / the WWW / svn / Warehouse 
# folders authorization 
[root @ localhost ~] chown -R & lt apache.apache # / var / WWW / the svn 
# passwd file and create a user access control files the authz 
[the root @ localhost ~] # Touch / var / WWW / the svn / passwd 
[the root @ localhost ~] # Touch / var / www / svn / authz

5. Configure the installed PHP & IF.SVNadmin

[root@localhost ~]# cd /tmp
[root@localhost tmp]# wget http://sourceforge.net/projects/ifsvnadmin/files/svnadmin-1.6.2.zip/download
[root@localhost tmp]# unzip iF.SVNAdmin-stable-1.6.2
[root@localhost tmp]# mkidr -p /var/www/html/svnadmin
[root@localhost tmp]# cp -r iF.SVNAdmin-stable-1.6.2/* /var/www/html/svnadmin
[root@localhost tmp]#  cd /var/www/html
[root@localhost html]# chown -R apache.apache svnadmin
[root@localhost html]# cd /var/www/html/svnadmin
[root@localhost html]# chmod -R 777 data
[root@localhost html]# chmod -R 777 /var/www/svn/passwd 
[root@localhost html]# chmod -R 777 /var/www/svn/authz
[root@localhost html]# vim /etc/sysconfig/svnserve
OPTIONS="-r /var/www/svn" 

6. Turn off the firewall, start the service

[root@localhost  html]# firewall-cmd --permanent --add-service=http
[root@localhost  html]# firewall-cmd --permanent --add-service=https
[root@localhost  html]# firewall-cmd --reload 
[root@localhost  html]# systemctl start httpd
[root@localhost  html]# systemctl enable httpd

7. Configure:
the browser address enter http: // ip / svnadmin configuration interface appears, enter the figure configuration information, configuration information for each input can click Test to test whether the next input is correct, the last saved configuration

8. If you need to use https, I suggest you use public certificates, which do configuration Configuration:

[root@localhost ~]#vim /etc/httpd/conf.d/ssl.conf
#这里配置证书路径
SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/private/server.key
SSLCertificateChainFile /etc/pki/tls/certs/example.com.ca-bundle

第二种:只安装服务器核心,通过命令行来管理

1、yum 安装subversion

[root@localhost /] yum install subversion

2、创建仓库

[root@localhost /]# cd /home
[root@localhost home]# mkdir svn
[root@localhost home]# svnadmin create /home/svn

3.配置passwd

[root@localhost conf]# vi passwd 
[users]
test1=123456
test2=123456

4、配置authz

[root@localhost conf]# vi authz 
[/]
liuxianan=rw
test1=r
test2=r
*=

5、使用用户分组

格式说明:
版本库目录格式:
[<版本库>:/项目/目录]
@<用户组名> = <权限>
<用户名> = <权限>

[root@localhost conf]# vi authz
[groups]
group1 = liuxianan
group2 = test1,test2
[/]
@group1 = rw
@group2 = r
* =

6、配置svnserve.conf

[root@localhost conf]# vi svnserve.conf 
 #匿名用户可读
anon-access = read
 #授权用户可写
auth-access = write
 #使用哪个文件作为账号文件
password-db = passwd
#使用哪个文件作为权限文件
authz-db = authz
# 认证空间名,版本库所在目录
realm = /home/svn 

7、启动与停止

[root@localhost conf]# svnserve -d -r /home/svn(启动)
[root@localhost conf]#kill all svnserve(停止)

 客户端安装

https://www.cnblogs.com/ygj0930/p/6623148.html

其它参考链接

https://www.runoob.com/svn/svn-tutorial.html

 

Guess you like

Origin www.cnblogs.com/vcdx/p/11139811.html