Installing and Configuring Subversion

I also recently went through the process of installing and configuring subversion for a company.

Here were some of the notable steps

 

References:

 

Steps:

INTSTALLING AND MAKING SUBVERSION AVAILABLE

  1. Install subversion:
  • yum install subversion

 

  1. Install subversion mod_dav_svn plugin for apache 2.0 integration:
  • yum install mod_dav_svn

 

  1. 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

    

  1. 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>

    

  1. Add the users to the password file:
    1. 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

 

 

  1. Configure Putty to go against repository: https://surveyor.verdiem.com/vrepos

 

       
 

This is how the repository will look on the 

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s