Subversion Installation with Submin, WebDAV, & WebSVN

Installation of Subversion with:

  • Submin for administering subversion users and repositories
  • WebDAV for access to repositories
  • WebSVN for browser access to repositories

Subversion Installation:

aptitude install subversion

Submin Installation:

Add the following repository to /etc/apt/sources.list:

# Submin Repository
deb http://debian.supermind.nl/ current main

Install key for submin repository:

wget -q -O - http://supermind.nl/debian.key | apt-key add -

Update Package List and Install Submin:

aptitude update
aptitude install submin

Create Folder Structure and Files:

mkdir /var/svn
mkdir /var/svn/conf
mkdir /var/svn/repos
touch /var/svn/conf/authz
touch /var/svn/conf/htpasswd
touch /var/svn/conf/submin.conf
touch /var/svn/conf/userproperties.conf
touch /var/svn/conf/apache-svn.alias

Add Submin Admin User

htpasswd -m /var/svn/conf/htpasswd administrator

Configuration File Contents:

# /var/svn/conf/authz
[groups]
submin-admins = administrator
#/var/svn/conf/submin.conf
[svn]
authz_file = /var/svn/conf/authz
userprop_file = /var/svn/conf/userproperties.conf
access_file = /var/svn/conf/htpasswd
repositories = /var/svn/repos

[www]
base_url = /submin
svn_base_url = /svn
trac_base_url =

[backend]
bindir = /usr/share/submin/bin

[generated]
session_salt = d7xOuU8hY9cF1qB/u/
# /var/svn/conf/apache-svn.conf
# Default Apache Submin Configuration

Alias /submin /usr/share/submin/www
<Directory /usr/share/submin/www>
 Options ExecCGI FollowSymLinks
 AddHandler cgi-script py cgi pl
 SetEnv SUBMIN_CONF /var/svn/conf/submin.conf  

 RewriteEngine on
 RewriteBase /submin                           

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.+)$ submin.cgi/$1              

 RewriteRule ^/?$ submin.cgi/                  

 Order Allow,Deny
 Allow from all
</Directory>                                   

# WebDAV Configuration
<Location /svn>
 DAV svn
 SVNParentPath /var/svn/repos
 AuthzSVNAccessFile /var/svn/conf/authz        

 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /var/svn/conf/htpasswd
 Require valid-user                            

 Order Allow,Deny
 Allow from all
 Satisfy Any
</Location>                                    

# WebSVN Configuration
Alias /websvn "/var/svn/websvn/"
<Directory "/var/svn/websvn/">
 Options -Indexes -FollowSymLinks
 AllowOverride None                            

 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /var/svn/conf/htpasswd
 Require valid-user                            

 Order Allow,Deny
 Allow from all
 Satisfy All
</Directory>

# Disallow web access to directories that don't need it
<Directory "/var/svn/websvn/include">
 Order Deny,Allow
 Deny from All
</Directory>

WebSVN Installation

  • Download WebSVN from http://www.websvn.info/download/.
  • Extract the contents of the archive to /var/svn/ and rename the folder from 'websvn-?.?.?' to just 'websvn‘.
cd /var/svn
wget http://websvn.tigris.org/files/documents/1380/47525/websvn-2.3.1.tar.gz
tar -xvzf websvn-2.3.1.tar.gz
mv websvn-2.3.1 websvn
  • Configure WebSVN with the following file:
<?php
// # /var/svn/websvn/include/config.php

$config->setSvnConfigDir('/etc/subversion');
$config->parentPath('/var/svn/repos');
$config->addTemplatePath($locwebsvnreal.'/templates/calm/');
$config->addTemplatePath($locwebsvnreal.'/templates/BlueGrey/');
$config->addTemplatePath($locwebsvnreal.'/templates/Elegant/');
$config->useAuthenticationFile('/var/svn/conf/authz'); // Global access file
$config->addInlineMimeType('text/plain');
$config->setMinDownloadLevel(2);
$config->useGeshi();
set_time_limit(0);
$config->expandTabsBy(8);

Configure Permissions:

chown -R root:www-data /var/svn
chmod -R ug=rwX,o= /var/svn/conf
chmod g-w /var/svn/conf/apache-svn.conf
chmod -R ug=rwX,o= /var/svn/repos
chmod -R 750 /var/svn/websvn

Configure Apache:

  • Enable Apache Mod Rewrite
ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
  • Include the required apache configuration by adding a symlink to the apache conf.d directory
ln -s /var/svn/conf/apache-svn.conf /etc/apache2/conf.d/apache-svn.conf
  • Restart Apache Server
/etc/init.d/apache2 restart

SVN on Ubuntu

Repository Location: /var/lib/submin/svn

/etc/apache2/sites-available/fender-svn.alias

# /submin and /svn from /etc/submin/default-apache-cgi.conf

Alias /submin /usr/share/submin/www
<Directory /usr/share/submin/www>
 Options ExecCGI FollowSymLinks
 AddHandler cgi-script py cgi pl
 SetEnv SUBMIN_CONF /etc/submin/default.conf

 RewriteEngine on
 RewriteBase /submin

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.+)$ submin.cgi/$1

 RewriteRule ^/?$ submin.cgi/

 Order Allow,Deny
 Allow from all
</Directory>
<Location /svn>
 DAV svn
 SVNParentPath /var/lib/submin/svn
 AuthzSVNAccessFile /var/lib/submin/authz

 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /var/lib/submin/htpasswd
 Require valid-user

 Order Allow,Deny
 Allow from all
 Satisfy Any
</Location>

Alias /websvn "/var/www/websvn/"
<Directory "/var/www/websvn/">
 Options -Indexes -FollowSymLinks
 AllowOverride None

 AuthType Basic
 AuthName "Subversion repository"
 AuthUserFile /var/lib/submin/htpasswd
 Require valid-user

 Order Allow,Deny
 Allow from all
 Satisfy All
</Directory>

Netbeans Installation and Import from Subversion Repository

Package Installation:

  • Install the Java Development Kit from here.
  • Install the Netbeans PHP Bundle from here.
  • Install the CollabNet Subversion Client for Netbeans from here.

Configuration:

  • Start the NetBeans IDE
  • Tools menu > Plugins … Install the “Bundled Subversion Client for Windows” plugin.
  • Tools menu > Options >> Misc page > Versioning tab > Subversion …
    Path to the SVN executable: CollabNet SVN Client installation folder

Import Project from Subversion Repository:

  • Team Menu > Subversion >Checkout…
  • Note that NetBeans project Run properties will need to be manually configured.

Delay between username and password on SSH login

The delay is likely caused by the server being unable to do a reverse dns lookup for the client machine.  There are a couple of solutions:

  1. Add the client’s hostname and IP address to the server’s /etc/hosts file
  2. Add the PTR record for the client machine to the DNS server.
  3. Add the following line to the server’s /etc/ssh/sshd_config file:
    UseDNS no

NTP Cron Job

If necessary, install ntpdate and test it as follows:

sudo apt-get install ntp ntpdate
sudo ntpdate ca.pool.ntp.org

Then create a daily cron script…

sudo vi /etc/cron.daily/ntpdate.sh

… with the following contents:

#!/bin/bash
ntpdate ca.pool.ntp.org > /dev/null
exit 0

Finally, set the execute bit for the new script and test it!

sudo chmod +x /etc/cron.daily/ntpdate.sh
sudo /etc/cron.daily/ntpdate.sh

Jaunty 64-bit Install Comments

To install VLC Media Player, run the following in the terminal:

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7613768D

Then add the following to sources:

deb http://ppa.launchpad.net/c-korn/vlc/ubuntu jaunty main

Install Firefox 3.5 using Ubuntuzilla.  Using about:config, set network.dns.disableIPv6 to true.
Installation of Adobe Flash Player (credit): since Ubuntzilla installs a 32-bit version of Firefox, the 32-bit version of Flash Player is required. Download the tar’ed linux version of Flash Player from adobe and copy the libflashplayer.so file to the ~/.mozilla/plugins/ directory (create the plugins directory if necessary).

Reinstall Ubuntu Grub Bootloader After Windows Wipes it Out

If you run a dual-boot system with Linux and Windows, this has happened to you. You had to do your monthly reinstall of Windows, and now you don’t see the linux bootloader anymore, so you can’t boot into Ubuntu or whatever flavor of linux you prefer.

Here’s the quick and easy way to re-enable Grub.

1) Boot off the LiveCD

2) Open a Terminal and type in the following commands, noting that the first command will put you into the grub “prompt”, and the next 3 commands will be executed there. Also note that hd0,0 implies the first hard drive and the first partition on that drive, which is where you probably installed grub to during installation. If not, then adjust accordingly.

sudo grub

> root (hd0,0)

> setup (hd0)

> exit

Reboot (removing the livecd), and your boot menu should be back.

Only read below if Windows is now missing from the boot menu

If you installed Ubuntu before you installed Windows, then Ubuntu will not have anything in the grub configuration for Windows. This is where you’ll have to do a bit of manual editing to the grub boot menu file.

If you open the file /boot/grub/menu.lst with the following command:

sudo gedit /boot/grub/menu.lst

You’ll see a sample section for Windows, which you’ll want to uncomment and add to the boot menu list in whatever position you want it in. (uncomment by removing the #’s)

# title   Windows 95/98/NT/2000
# root   (hd0,0)
# makeactive
# chainloader   +1

Note that you should also verify that hd0,0 is the correct location for Windows. If you had installed Windows on the 4th partition on the drive, then you should change it to (hd0,3)

Credit