Select Page

Installing Subversion on OpenSuse and Plesk 9

Installing Subversion on OpenSuse and Plesk 9

subversion_logo-384x332 geeko plesk.logo Subversion (SVN) is an open source version control system. It allows users to keep track of changes made over time to any type of electronic data. Typical uses are versioning source code, web pages or design documents.

I now host my own private subversion at http://svn.waltercedric.com

A required step to be able to build some small project and finish the prototype of Continuous build for Joomla!

How to install Subversion SVN on Plesk 9

Requirement: having a root access to your server.

Install Subversion

# zypper se subversion 
Read installed Package…

S | Name              | Zusammenfassung                                                | Type 
–+——————-+—————————————————————-+——
  | subversion        | A Concurrent Versioning system similar to but better than CVS  | Package
  | subversion-devel  | Development package for Subversion developers                  | Package
  | subversion-doc    | Documentation files for Subversion                             | Package
  | subversion-perl   | Allows Perl scripts to directly use Subversion repositories.   | Package
  | subversion-python | Allows Python scripts to directly use Subversion repositories. | Package
  | subversion-server | Apache server module for Subversion server                     | Package
  | subversion-tools  | Tools for Subversion                                           | Package

And install the required package, at least subversion  and subversion-server

# zypper in subversion
# zypper in subversion-server

Add a new group and user for more security (one user for every daemon with limited or no rights to do something else is a good Linux guideline!)

# groupadd svn
# useradd -d /srv/svn -s /bin/false svn

Create the root of Subversion

# mkdir /srv/svn/
# mkdir /srv/svn/repos

Prepare Plesk 9

Now the most easiest part, I create a new sub domain using Plesk adminitrator panel

http://svn.waltercedric.com

I move the default configuration file from /etc/apache2/conf.d/ to the sub domain conf directory

# mv /etc/apache2/conf.d/subversion.conf /srv/www/vhosts/waltercedric.com/subdomains/svn/conf/

# mv subversion.conf vhost.conf

And change some settings

# vi vhost.conf

ServerName svn.waltercedric.com
ErrorLog    /var/log/apache2/svn.example.com-error_log
TransferLog /var/log/apache2/svn.example.com-access_log
#
# Do not set DocumentRoot. It is not needed here and just causes trouble.
#
# Map the error documents back to their defaults.
# Otherwise mod_dav_svn tries to find a “error” repository.
#
ErrorDocument 400 default
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 408 default
ErrorDocument 410 default
ErrorDocument 411 default
ErrorDocument 412 default
ErrorDocument 413 default
ErrorDocument 414 default
ErrorDocument 415 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 502 default
ErrorDocument 503 default 
    <Location />
      DAV svn
      SVNParentPath  /srv/svn/repos
      SVNListParentPath on
      AuthType Basic
      AuthName “subversion repository”
      AuthBasicProvider file
      AuthUserFile /srv/svn/auth/svn.htpasswd
      SetOutputFilter DEFLATE
      <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
      </LimitExcept>
    </Location>

</IfModule>

To reread and include overridden vhost.conf, and tell Plesk that you have create new vhost.conf, run at least once 
# /usr/local/psa/admin/sbin/websrvmng

Prepare Apache

I install the DAV (Web-based Distributed Authoring and Versioning) modules by running

# a2enmod dav
# a2enmod dav_svn

Which is the same as editing vi /etc/sysconfig/apache2 and adding dav and dav_svn to the list of loaded module.

Preparing the file system

Set up the password file:

# mkdir /srv/svn/auth # vi /srv/svn/auth/svn.htpasswd

Change the group so that ONLY Apache can access it

# chown wwwrun:www /srv/svn/auth/svn.htpasswd

Tighten all permissions

# chmod 640 /srv/svn/auth/svn.htpasswd

Tighten the repository

# chown -R wwwrun:www /srv/svn/repos/

# find /srv/svn/repos/ -type d -exec chmod 755 {} \;

# find /srv/svn/repos/ -type f -exec chmod 644 {} \;

Add SVN Users

# htpasswd2 /srv/svn/auth/svn.htpasswd xxxx.yyyy

and enter the password twice.

Create some root repositories

# svnadmin create /srv/svn/repos/joomla

I am root, so I give way to less permissions to the new repository for Apache, so I give rights back to Apache.

# chown –R wwwrun:www /srv/svn/repos/joomla

Restart Apache / Subversion

# rcapache2 restart

Start the daemon

# /etc/init.d/svnserve  start

Point your browser to http://svn.waltercedric.com

svn.waltercedric.com.result

Additionnal Help

About The Author

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.

Categories