This topic describes how to deploy access to Apache Subversion (SVN) over HTTP.

Prerequisites

You must have an Alibaba Cloud account before you follow the instructions provided in the tutorial. To create an Alibaba Cloud account, click Create an Alibaba Cloud account.

Background information

In this topic, the following software versions are used to manually deploy SVN. The versions may be different in your actual running environment.
  • Operating system: public image 64-bit CentOS 7.2
  • Subversion: version 1.7.14
  • Apache HTTP Server: version 2.4.6

Procedure

Step 1: Install SVN

To install SVN, follow these steps:

  1. Connect to a Linux instance by using a password.
  2. Run the following command to install SVN.
    yum install subversion
  3. Run the following command to check the SVN version.
    svnserve --version

Step 2: Install Apache

To install Apache, follow these steps:

  1. Run the following command to install the Hypertext Transfer Protocol daemon (HTTPd).
    yum install httpd
  2. Run the following command to check the HTTPd version.
    httpd -version

Step 3: Install mod_dav_svn

Run the following command to install mod_dav_svn.
yum install mod_dav_svn

Step 4: Configure SVN

To configure SVN, follow these steps:

  1. Run the following command to create a root directory for an SVN repository.
    mkdir /var/svn
  2. Run the following command to create an SVN repository.
    svnadmin create /var/svn/svnrepo
  3. Run the following command to specify apache as the user group of the SVN repository.
    chown -R apache:apache /var/svn/svnrepo
  4. Run the following command to create a configuration file named passwd.
    touch /var/svn/passwd 
  5. Run the following command to create the admin user and set the password. In this example, set the password to admin123.
    htpasswd /var/svn/passwd admin
  6. Run the following command to create an access permission file.
    cp /var/svn/svnrepo/conf/authz /var/svn/authz

Step 5: Configure Apache

To configure Apache, follow these steps:

  1. Run the command vim /etc/httpd/conf.d/subversion.conf to open the HTTPd configuration file.
  2. Press the i key to enter the edit mode.
  3. Enter the following configuration information:
    <Location /svn>
    DAV svn
    SVNParentPath /var/svn
    AuthType Basic
    AuthName "Authorization SVN"
    AuthzSVNAccessFile /var/svn/authz
    AuthUserFile /var/svn/passwd
    Require valid-user
    </Location>
  4. Press the Esc key, and type :wq to save and close the file.
  5. Run the following command to start the Apache HTTP Server.
    systemctl start httpd.service

Step 6: Configure the security group rules

The SVN server listens on TCP Port 3690 by default. You must log on to the ECS console to add TCP Port 3690 to the security group. For more information, see Add security group rules.

Step 7: Use a browser to test access to SVN

To test access to SVN in a browser, follow these steps:

  1. Open your browser.
  2. In the address bar, enter the URL http://<Public IP address of the ECS instance>/svn/<SVN repository name>, and press the Enter key. In this example, the SVN repository name is svnrepo.
  3. Enter your username and password that you have configured in the passwd file. In this example, the username is admin and the password is admin123.
    The following response indicates that you have accessed the SVN repository that you have created.
    Access result