centos7 Builds SVN+Apache+IF.svnadmin to Realize web Management SVN

Keywords: Linux svn Apache PHP firewall

Reading catalogue

1. Introduction

The company recently wanted to migrate the SVN of Windows server platform to Linux platform; this side has been tested successfully, so write a note with it.

Today I write about the construction of SVN Server based on Apache and HTTP access on CentOS 7, and the implementation of web Background Visual Management SVN based on IF.svnadmin.

 

2. Software preparation

Installation of relevant software packages

The installation process is as follows:

1. Install apache

[root@localhost ~]# yum install httpd -y

2. Install SVN server (where mod_dav_svn is a module for apache server to access svn)

[root@localhost ~]# yum install mod_dav_svn subversion -y

3. After the installation is completed, you can check whether the installation is successful by following commands
[root@localhost ~]# httpd -version

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

mod_authz_svn.so
mod_dav_svn.so
3. Configure svn under apache 

[root@localhost ~]# vim /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /var/www/svn   #Root directory of svn
AuthType Basic               #Basic authentication
AuthName "Authorization SVN"   #Information displayed during authentication
AuthUserFile /var/www/svn/passwd      #User File & Password
AuthzSVNAccessFile /var/www/svn/authz  #Access permission control file
Require valid-user            #Require real users, not anonymous
</Location>

 

3. Establishment of SVN Server Warehouse

Build the svn repository with the following commands

Where / var/www/svn is the directory to be stored in the warehouse. This directory can be placed in multiple code warehouses.

[root@localhost ~]# mkdir /var/www/svn

[root@localhost ~]# svnadmin create /var/www/svn/sungeek
[root@localhost ~]# ls /var/www/svn/sungeek
             --->  conf  db  format  hooks  locks  README.txt
[root@localhost ~]# chown -R apache.apache /var/www/svn

//Create user file passwd and privilege control file authz
[root@localhost ~]# touch /var/www/svn/passwd 

[root@localhost ~]# touch /var/www/svn/authz

 

 

4. Configure and install PHP&IF.SVNadmin

Because iF.SVNAdmin is written in php, we need to install PHP

[root@localhost ~]# yum install php -y

//Installation Configuration if.svnadmin

[root@localhost ~]# wget http://sourceforge.net/projects/ifsvnadmin/files/svnadmin-1.6.2.zip/download
[root@localhost ~]# cd /usr/src/
[root@localhost src]# unzip iF.SVNAdmin-stable-1.6.2
[root@localhost iF.SVNAdmin-stable-1.6.2]# cp -r iF.SVNAdmin-stable-1.6.2/ /var/www/html/svnadmin
[root@localhost ~]# 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

 

5. Start-up Services Start-up Services Start-up Services Start-up Services Start-up Services Start-up Services

If the firewall is enabled, httpd access rights need to be enabled

[root@localhost ~]# firewall-cmd --permanent --add-service=http
[root@localhost ~]# firewall-cmd --permanent --add-service=https
[root@localhost ~]# firewall-cmd --reload 
 

By looking at the file / usr / lib / system D / system / svnserve. service, you can see that the configuration file of svnserver is / etc/sysconfig/svnserve
Modify / etc/sysconfig/svnserve

[root@localhost ~]# vim /etc/sysconfig/svnserve
OPTIONS="-r /var/svn"     
======> OPTIONS="-r /var/www/svn" 

Enable the service by following commands

[root@localhost ~]# systemctl start httpd.service

The following command makes it boot-up and self-start

[root@localhost ~]# systemctl enable httpd.service

Restart Apache

[root@localhost ~]# systemctl restart httpd.service

After launching the web server service, the browser address input http://ip/svnadmin configuration interface appears, input the configuration information in the following figure, enter each configuration information can click next to Test whether the input is correct, and finally save the configuration.

After saving, the default account will be prompted to admin/admin.

After landing, we can add the project directory under Repositories.

Add users under Users.

Under Access-Paths, users of corresponding projects are associated and relevant read and write permissions are allocated.

 

 

Sungeek original, reprinted remember to note the origin, thank you!

http://www.cnblogs.com/Sungeek/

Posted by friedice on Sun, 23 Dec 2018 03:48:06 -0800