Set up SVN + Apache + IF. svnadmin on centos7 to implement web management SVN and centos7svn

Source: Internet
Author: User

Set up SVN + Apache + IF. svnadmin on centos7 to implement web management SVN and centos7svn

Reading directory

  • 1. Introduction
  • 2. Software preparation
  • 3. Create a SVN Server Repository
  • 4. Configure and install PHP & IF. SVNadmin
  • 5. Start the service
1. Introduction

Recently, the company wanted to migrate SVN from Windows server to Linux. After testing, we wrote a record as needed.

Today I wrote about building the SVN Server Based on Apache and http on CentOS7; and Implementing Visual Management of SVN on the web Background using IF. svnadmin.

 

2. Software preparation

Install related software packages

The installation process is as follows: 1. install apache [root @ localhost ~] # Yum install httpd-y2. install the svn server (mod_dav_svn is a module used by the apache server to access svn) [root @ localhost ~] # Yum install mod_dav_svn subversion-y

3. After the installation is complete, run the following command to check whether the installation is successful:
[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.soLoadModule authz_svn_module modules/mod_authz_svn.so <Location/svn> DAV svnSVNParentPath/var/www/svn # svn root directory AuthType Basic # authentication Basic authentication method AuthName "Authorization SVN "# authUserFile/var/www/svn/passwd # user File & password AuthzSVNAccessFile/var/www/svn/authz # The access permission control file Require valid-user # requires real users, cannot be anonymous </Location>
3. Create a SVN Server Repository

Run the following command to create a svn Repository:

/Var/www/svn is the directory to be stored in the repository. This directory can contain multiple code repositories.

[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 permission 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 install and configure 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 the service

If the firewall is enabled, you must enable the httpd access permission.

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

View the/usr/lib/systemd/system/svnserve. service file and find that the configuration file of svnserver is/etc/sysconfig/svnserve.
Modify/etc/sysconfig/svnserve

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

Run the following command to enable the Service:

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

Run the following command to enable auto-start

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

Restart Apache

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

After the webserver service is started, enter http: // ip/svnadmin in the browser address to display the configuration interface. Enter the configuration information in the browser, enter each configuration information, and click Test next to it to Test whether the input is correct, last save Configuration

After saving, the system prompts that the default account is admin/admin.

After logging in, we can add a project directory under "Repositories;

Add a user under "Users;

Associate users of the corresponding project under "Access-Paths" and assign relevant read and write permissions.

 

 

Original Sungeek. Reprinted and remember the source of the remarks. Thank you!

Http://www.cnblogs.com/Sungeek/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.