Version 59, last updated by Vitalie Lazu at September 30, 2011 16:49 UTC
Setup a subversion server
A subversion server hosts subversion repositories and serves them with http. It uses the ernie Control Center to serve RPC calls that create, destroy, and copy repositories, and provide information for the Source/svn code browser. It serves SVN with an Apache web server with a python module for authentication
Unfortunately ruby bindings for SVN are not available for Windows, so you cannot use this platform with SVN server and Breakout. These instructions work best for Debian or Ubuntu. You can run this server on a virtual machine.
Install the Control Center
Install the Control Center using these instructions.
Install Subversion
sudo apt-get install swig libsvn-ruby libuconv-ruby1.8 libapr1-dev libaprutil1-dev
You can use any Subversion version.
Install from binaries
sudo apt-get install subversion libsvn-ruby libuconv-ruby1.8
More install options are at the end of these instructions.
Install Apache Python modules
sudo apt-get install pythonsudo apt-get install libapache2-mod-python
Install Subversion components
Install Neon library
sudo apt-get install libneon27
Install subversion server modules for Apache
sudo apt-get install libapache2-svn
You might want to setup a Subversion virtual host. Since that is not mandatory, I moved the instructions to the bottom. You can use file:///absolute/path/to/local/repository instead when using the repo.
Configure and launch control center
- Install initial configuration file:
cd <breakout-control-home>/etc
cp control.yml.example control.yml
- Edit control.yml for these subversion parameters:
subversion:
base_dir: /opt/breakout/svn
hooks:
pre_revprop_change: /absolute/path/to/breakout-control/hooks/svn/pre_revprop_change
post_commit: /absolute/path/to/breakout-control/hooks/svn/post_commit
- Launch Ernie Control Center. In breakout-control project, in different terminal windows: rake start or rake ernie
- Optional: to use svn export functionality localy:
export CONTROL_DIR=breakout-control-dir/etc/ or put control.yml in /etc/breakout-control
Setup Breakout
You must configure breakout for a Source/Svn tool server.
-
To add Svn repository, be sure to have event processing set up http://www.assembla.com/wiki/show/assembladev/Setup_event_processing
- Login as super user default login/password is super/super
- Open http://localhost:3000/tool_servers page.
- Add new tool server for "Source/Svn" (if not already there)
- Configure the "Dns name" and "Private dns name" of your subversion server (svn.localhost).
- Be sure to check For new and Is Active checkboxes.
You should have it all working now.
Optional stuff:
Configure Subversion virtual host
Decide where you want to store your repositories and make sure that Apache can write to the base directory. In this example I will use /opt/breakout/svn. So Apache should have write permissions for /opt.
Follow instructions at Setup authorization and authentication
Create a file /etc/apache2/breakout/svn_common:
DocumentRoot "/var/www/"
SetHandler mod_python
PythonDebug On
<Location "/svn/">
DAV svn
SVNParentPath /opt/breakout/svn
SVNAutoversioning On
AuthType Basic
AuthName "Restricted Area"
PythonAccessHandler breakout.svn_access
PythonAuthenHandler breakout.svn_access
</Location>
LogLevel debug
Include /etc/apache2/breakout/py_auth
Create a file /etc/apache2/sites-enabled/svn.localhost:
<VirtualHost *:80>
ServerName svn.localhost
Include /etc/apache2/breakout/svn_common
ErrorLog /var/log/apache2/svn-breakout-error.log
CustomLog /var/log/apache2/svn-breakout-access.log combined
</VirtualHost>
Add this line to /etc/hosts
127.0.0.1 svn.localhost
Restart Apache:
sudo /etc/init.d/apache2 restart
Now you can import a test project into the repository using your favorite SVN client (check out our reviews if you need help choosing) and the following URL http://svn.localhost/svn/test_repo.
Additional SVN install options:
If you want to install from source, download Subversion source, extract and while in the directory type
./configure && make && sudo make install
Make sure svnadmin binary can be accessed at /usr/bin/svnadmin. For example I had to create a symbolic link:
sudo ln -s /usr/local/bin/svnadmin /usr/bin/svnadmin
While still in the Subversion source directory type:
make swig-rb && sudo make install-swig-rb
Note: if you are using a 64bit operating system, then you might receive such error when compiling swig-rb:
/usr/bin/ld: /usr/local/lib/libruby-static.a(array.o): relocation R_X86_64_32 against `a local symbol' can
not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libruby-static.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
The solution for that is to recompile and install ruby with the following command:
make clean && ./configure --enable-shared && make && sudo make install
You can also run the tests with the following command (it takes some time!):
make check-swig-rb