This topic describes how to deploy access to Apache Subversion (SVN) over HTTP.
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.
- Operating system: public image 64-bit CentOS 7.2
- Subversion: version 1.7.14
- Apache HTTP Server: version 2.4.6
Step 1: Install SVN
To install SVN, follow these steps:
- Connect to a Linux instance by using a password.
- Run the following command to install SVN.
yum install subversion
- Run the following command to check the SVN version.
Step 2: Install Apache
To install Apache, follow these steps:
- Run the following command to install the Hypertext Transfer Protocol daemon (HTTPd).
yum install httpd
- Run the following command to check the HTTPd version.
Step 3: Install mod_dav_svn
yum install mod_dav_svn
Step 4: Configure SVN
To configure SVN, follow these steps:
- Run the following command to create a root directory for an SVN repository.
- Run the following command to create an SVN repository.
svnadmin create /var/svn/svnrepo
- Run the following command to specify apache as the user group of the SVN repository.
chown -R apache:apache /var/svn/svnrepo
- Run the following command to create a configuration file named passwd.
- 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
- 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:
- Run the command
vim /etc/httpd/conf.d/subversion.confto open the HTTPd configuration file.
- Press the
ikey to enter the edit mode.
- 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>
- Press the
Esckey, and type
:wqto save and close the file.
- 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:
- Open your browser.
- 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.
- 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.