How To

Download and install FreeNAS
  • Reserve some space on OS partition for later adding packages. (500MB should be enough)

System Configuration

  • Configure network (you_static_ip, DNS, ...)
  • Log on to FreeNAS admin GUI http://your_static_ip
  • [optional]
    • Change admin http port from 80 (default) to 8080 and reboot
    • The port 80 will be used by webSVN
  • Manage disks
    •   - Mount data partition to /mnt/data
  • Services
    • Turn on Samba or Ftp in order to transfer external files in
    • Enable webserver (will be used by websvn)
      •   - Port 80
      •   - Add document root /mnt/data/svn/www
  • Access
    • Add group name svn
    • Add user name svn


Install Additional Packages

  • Log on to Unix shell
% mkdir -p /mnt/data/svn/rep
% pkg_add -r subversion
% pkg_add -r vim (optional)
  • pkg_add websvn will crash FreeNAS admin GUI.  Instead of using pkg_add, do it manually
% cd /mnt/data/svn
% gzip -cd websvn.gz.tar | tar xvf -
% mv websvn www

SVN setup
Create repository
% svnadmin create /mnt/data/svn/rep/ws_1 (ws_1 is an example)

Configure repository
% vi /mnt/data/svn/rep/ws_1/conf/svnserve.conf
anon-access = none
auth-access = write
password-db = passwd
% vi /mnt/data/svn/rep/ws_1/conf/passwd
[users]
user_abc = blahblah

Create encrypted password
perl -e '$pass="mypasswd"; print crypt($pass, $pass);'

Start svn service
% svnserve -d -r /mnt/disk/svn/rep

Configure svn service for server reboot
% vi /etc/rc.conf  (start service on reboot)
svnserve_enable="YES"
svnserve_flags="-d --listen-host your_ip -r /mnt/data/svn/rep"

% vi /etc/rc.d/svnserve.sh
#!/bin/sh
. /etc/rc.subr

name="svnserve"
rcvar=`set_rcvar`
command="/usr/local/bin/${name}"

load_rc_config $name
run_rc_command "$1"

Eclipse Usage
  • Commit project to svn://your_ip/ws_1


Configure WebSVN

% cd /mnt/data/svn/www/include
% cp distconfig.php config.php
% vim config.php
$config->setSVNCommandPath('/usr/local/bin');
$config->addRepository('ws_1', 'file:///mnt/data/svn/rep/ws_1');
$config->parentPath('/mnt/data/svn/rep');


WebSVN Usage
http://your_ip


原文取自 http://sites.google.com/site/practicallyequipped/setup-svn-on-freenas 


創作者介紹

經驗交流分享與備忘

Frank 發表在 痞客邦 PIXNET 留言(0) 人氣()