Install Subversion

From OpenFSG
Jump to: navigation, search

Subversion is an open source application used for revision control. It is sometimes abbreviated to svn in reference to the name of its command line interface. Subversion is designed specifically to be a modern replacement for CVS and shares a number of the same key developers. (for more information: http://en.wikipedia.org/wiki/Subversion)

  1. Follow the instructions for installing ipkg.
  2. Install cyrus-sasl-libs
  3. / # ipkg install cyrus-sasl-libs
    Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/cyrus-sasl-libs_2.1.20-8_armeb.ipk
    Installing cyrus-sasl-libs (2.1.20-8) to root...
    Configuring cyrus-sasl-libs
    Successfully terminated.
    
  4. Install openldap-libs and dependencies
  5. / # ipkg install openldap-libs
    Downloading http://ipkg.nslu2-linux.org/feeds/unslung/native/openldap-libs_2.2.26-5_armeb.ipk
    Installing openldap-libs (2.2.26-5) to root...
    Installing libdb (4.2.52-3) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/stable/libdb_4.2.52-3_armeb.ipk
    Installing gdbm (1.8.3-2) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/stable/gdbm_1.8.3-2_armeb.ipk
    Configuring gdbm
    Configuring libdb
    Configuring openldap-libs
    Successfully terminated.
    
  6. Install apr-util and dependencies
  7. / # ipkg install apr-util
    Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/apr-util_0.9.7-2_armeb.ipk
    Installing apr-util (0.9.7-2) to root...
    Installing apr (0.9.12-2) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/stable/apr_0.9.12-2_armeb.ipk
    Installing expat (2.0.0-3) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/stable/expat_2.0.0-3_armeb.ipk
    Configuring apr
    Configuring apr-util
    Configuring expat
    Successfully terminated.
    
  8. Finally install SVN
  9. / # ipkg install svn
    Downloading http://ipkg.nslu2-linux.org/feeds/unslung/cross/svn_1.3.2-1_armeb.ipk
    Installing svn (1.3.2-1) to root...
    Installing neon (0.24.7-1) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/stable/neon_0.24.7-1_armeb.ipk
    Installing libxml2 (2.6.26-1) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101/cross/stable/libxml2_2.6.26-1_armeb.ipk
    Configuring libxml2
    Configuring neon
    Configuring svn
    Successfully terminated.
    
    Add following line to /etc/inetd.conf where /home/subversion/repository/ is the directory where your repository is.
    svnserve  stream  tcp  nowait  root  /opt/bin/svnserve svnserve -i -r /home/subversion/repository/
    

The service name "svnserve" of this line should correspond to the port/service mapping defined in /etc/services file. you can quickly check that by running the command "cat /etc/services | grep svn". I haven't tried getting SVN working under apache only with svnserve. You will have to edit your-repos/conf/svnserve.conf to setup your authentication. I just gave anonymous write authority as my FSG is configured as a switch behind a couple of firewalls.

To give anonymous write access just uncomment the line in svnserve.conf

anon-access = write

Finally make sure the inetd daemon is running next time bu enabling the mail service (any better solution welcomed). If inetd is already running, you can ask him to reload configuraiton by running "kill -1 $(pidof inetd)"

Installing as a daemon

If you are not running inetd or for any other reason you want to run Subversion as a daemon itself, you may use the instructions given for Run a Script At Bootime. Brief summary follows:

  1. Login to SSH as root
  2. Create a startup script at /etc/init.d and make ot look like this:
  3. #!/bin/sh
    /opt/bin/svnserve -d -r /repository_root
    

    Remember to change /repository_root with the name of your repository root directory! You may insert the lines to open the ports to the WAN in this script. Look below.

  4. Make an 'Sxx' link to this script in /etc/rc.
  5. Make both link and script executable by root

Now you are done, without the need to run inetd daemon

Opening svnserve to the WAN

If you want to access your subversion repositories from the Internet, or from your local network when your FSG has been setup behind a router, you have to open svnserve's ports on the FSG's own firewall. Doing this is pretty similar to setting up an USB Printer through the WAN.

  1. Login as root
  2. Create a text file named "wan_svnserve" in /etc/init.d/
  3. Insert the following text:
    #! /bin/sh
    /sbin/iptables -I INPUT -i eth1 -p tcp --dport 3690 -j ACCEPT
    /sbin/iptables -I INPUT -i eth1 -p udp --dport 3690 -j ACCEPT
    

    (This opens port 3690 in TCP/UDP on your FSG)

  4. Create a link to that file as follows:
    ln -s /etc/init.d/wan_svnserve /etc/rc/S99wansvnserve
  5. Make sure both the file and the link are executable

Now you should be able to access your repositories from outside your FSG. Remember that if your FSG is behind a router, you'll have to add a port forwarding/triggering on the router to access the repositories from the internet. If you just want to access it from your local network, leave the router as it is.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox