This documentation uses variables denoted with a $ followed by a keyword, all this emphasized with red text (i.e. $variable). These variables should be replaced with appropriate values. Suggested default values are denoted with a variable followed by an equal sign and a value (i.e $variable = value).
How to configure Subversion on CentOS, RedHat, Linux
- Create a Security Certificate for Subversion
(see our OpenSSL Certificate Requestl tutorials)
- Create an HTTP Apache Virtual Host for Subversion
(see our Apache Virtual Host tutorials)
- Create an HTTPS Apache Virtual Host for Subversion
(see our Apache Virtual Host tutorials)
- Add the following text to the end of the HTTPS Apache Virtual Host directive, just above the Virtual Host ending tag (</VirtualHost>)
<Location />
DAV svn
SVNParentPath /var/www/svn
# List repositories in SVNParentPath
SVNListParentPath on
# Require SSL connection for password protection
SSLRequireSSL
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/subversion/.htpasswd
Require valid-user
</Location>
- Add the following custom log entry to the # Logging section of the HTTPS Apache Virtual Host directive, just below the ssl custom log entry
CustomLog logs/$domain-svn_logfile "%t %u %{SVN-ACTION}e" env=SVN-ACTION
- Redirect the HTTP Apache Virtual Host to the HTTPS Apache Virtual Host
(see our Apache mod_rewrite tutorials)
- Create an authentication file with our first user
htpasswd -cm /etc/subversion/.htpasswd $user
- Add additional users to our authentication file
htpasswd -m /etc/subversion/.htpasswd $user
Now that we have Subversion configured, we need to create a repository for storing our versioned files.