Foreword most senior programmers may now use github for code management tools. However, many companies still choose svn as the code version management tool considering the ease of implementation and the ability to accept the code, the following describes how to build an SVN repository based on Apache. Install svn related modules Ubuntu installation command sudoapt-getinstallsubversionlibapache2-svn after successful installation svn Configuration
Preface
Most senior programmers may now use github for code management tools. However, many companies still choose svn as the code version management tool considering the ease of implementation and the ability to accept the code, the following describes how to build an SVN repository based on Apache.
Install svn-related modules
Ubuntu installation command
Sudo apt-get install subversion libapache2-svn
After successful installation
Configure the svn version Library
Create svn root directory
Mkdir-p/home/svn
Create the required version Library
Cd/home/svn/
Sudo svnadmin create version library name
Modify the version library directory permission
Because svn is accessed through apache, the owner of the directory is www-data.
Sudo chown-R www-data.www-data version library name
Configure Apache
Modify the configuration file of apache based on the svn Module
Sudo vim/etc/apache2/mod-available/dav_svn.conf
After modification, the configuration file content is as follows:
# Dav_svn.conf-Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# The Subversion book.
#
# NOTE: for a setup with multiple vhosts, you will want to do this
# Configuration in/etc/apache2/sites-available/*, not here.
# ...
# URL controls how the repository appears to the outside world.
# In this example clients access the repository as http: // hostname/svn/
# Note, a literal/svn shocould NOT exist in your document root.
# Uncomment this to enable the repository
DAV svn
# Set this to the path to your repository
# SVNPath/home/svn
# Alternatively, use SVNParentPath if you have multiple repositories under
# Under a single directory (/var/lib/svn/repo1,/var/lib/svn/repo2 ,...).
# You need either SVNPath and SVNParentPath, but not both.
SVNListParentPath on
SVNParentPath/home/svn
# Access control is done at 3 levels: (1) Apache authentication,
# Any of several methods. A "Basic Auth" section is commented out
# Below. (2) Apache And , Also commented out
# Below. (3) mod_authz_svn is a svn-specific authorization module
# Which offers fine-grained read/write access control for paths
# Within a repository. (The first two layers are coarse-grained; you
# Can only enable/disable access to an entire repository.) Note that
# Mod_authz_svn is noticeably slower than the other two layers, so if
# You don't need the fine-grained control, don't configure it.
# Basic Authentication is repository-wide. It is not secure unless
# You are using https. See the 'htpasswd' command to create and
# Manage the password file-and the documentation for
# 'Auth _ basic 'and 'authn _ file' modules, which you will need for this
# (Enable them with 'a2enmod ').
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile/etc/apache2/dav_svn.passwd
# To enable authorization via mod_authz_svn
AuthzSVNAccessFile/etc/apache2/dav_svn.authz
# The following three lines allow anonymous read, but make
# Committers authenticate themselves. It requires the 'authz _ user'
# Module (enable it with 'a2enmod ').
#
Require valid-user
#
Note:
- And Appear in pairs
- DAV svn enables DAV module support
- Either SVNPath or SVNParentPath cannot appear at the same time. We recommend that you use SVNParentPath to create multiple SVN version libraries under the svn root directory.
- Enable BASIC Authentication
- Read more comments in English, which is very simple.