I also recently went through the process of installing and configuring subversion for a company.
Here were some of the notable steps
References:
-
Setting repository permissions for SELinux:
-
Main reference for Subversion setup
Steps:
INTSTALLING AND MAKING SUBVERSION AVAILABLE
- Install subversion:
- yum install subversion
- Install subversion mod_dav_svn plugin for apache 2.0 integration:
- yum install mod_dav_svn
-
Update the httpd.conf to load the mod_dav_svn.so module before any other subversion tasks. Add the following lines to /etc/httpd/conf.d/subversion.conf
LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
* If the firewall has www turned off on machine, you must enable this. For example, in fedora, this can be done via:
System-Security Settings and Firewall -> Add www to allowed
CREATING THE REPOSITORY
The following steps all happen on the server.
1. Make the svn repository
-
mkdir -p /home/repos/svn/vrepos
-
svnadmin create /home/repos/svn/vrepos
-
cchown –R apache.apache /home/repos/svn
* Note for SELinux / Fedora Core 3+ / Red Hat Enterprise users:
In addition to regular Unix permissions, under SELinux every file, directory, process, etc. has a ‘security context’. When a process attempts to access a file, besides checking the Unix permissions the system also checks to see if the security context of the process is compatible with the security context of the file.
Assuming your linux box has SELinux enabled, to run Subversion under Apache, you have to set the security context of the repository to allow Apache access (or turn off the restrictions on Apache, if you think all this is overkill). The chcon command is used to set the security context of files (similarly to how the chmod sets the traditional Unix permissions). For example, one user had to issue this command
– chcon -R -h -t httpd_sys_content_t /home/repos/svn
2. Set up a directory to import
– mkdir /home/repos/tmpsvn/vrepos
– cd /home/repos/tmpsvn/vrepos
- mkdir branches
- mkdir tags
- mkdir trunk
- mkdir trunk/ThirdParty
- mkdir trunk/Build – add build scripts to this folder
- mkdir trunk/Source – add Stargate and EcoTool folders to this
-
Add info to httpd configuration so that apache can serve repository and it will be password protected:
<Location /vrepos>
DAV svn
SVNPath /home/repos/svn/vrepos
SSLRequireSSL
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /home/repos/svn/svn-auth-file
Require valid-user
</Location>
-
Add the users to the password file:
-
For each user:
$$ ### First time: use -c to create the file
$ ### Use -m to use MD5 encryption of the password, which is more secure
$ htpasswd -cm /home/repos/svn/svn-auth-file davidq
New password: *****
Re-type new password: *****
$ htpasswd -m /home/repos/svn/svn-auth-file rossa
New password: *******
Re-type new password: *******
Adding password for user rossa
-
-
Configure Putty to go against repository: https://surveyor.verdiem.com/vrepos
This is how the repository will look on the