Install Apache + mod_svn_dev + SVN + user-friendly-svn on QNAP

The ipkg for QNAP can only install Apache web server & SVN server seperately, there is no way to load mod_svn_dav in order to obtain a web interface management system such as user-friendly-svn or svnmanager to work.

My soluction is recomplile Apache2, PHP5.4, Subversion 1.6.17, here is something you need to do before the compilation.

ipkg install grep ipkg install sed ipkg install gcc ipkg install binutils ipkg install make ipkg install autoconf ipkg install automake ipkg install diffutils ipkg install m4 ipkg install libxml2 ipkg install file ipkg install perl ipkg install libdb ipkg install gawk

By default the QNAP uses the grep, sed, awk from busybox which is a bit out of date, so we installed their latest version from the ipkg, then you will need to update the link in /bin

mv /bin/awk /bin/awk_bak ln -s /opt/bin/awk mv /bin/grep /bin/grep_bak ln -s /opt/bin/grep mv /bin/sed /bin/sed_bak ln -s /opt/bin/sed

NOTE: if you use ipkg install linuxutils again, you will re-do the link as the installation will roll back those command to busybox again.

Download icu-config, it is reuqired by php

wget tar xfvz icu4c-4_8_1_1-src.tgz ./configure --prefix=/path_to_you_preferred make && make install

Change the working directory to source code for apache2
configure with

./configure --prefix /path_to_you_preferred --enable-authz-host --enable-proxy --enable-proxy-http --enable-so --enable-rewrite --enable-vhost-alias --enable-modules --enable-dav --enable-so --enable-dav=shared --enable-dav-fs=shared make && make install

Change the working directory to source code for subversion1.6.17**

./configure --prefix=/path_to_you_preferred --with-apxs=/YOUR_APACHE_DIRECTORY/bin/apxs --with-apr=/YOUR_APACHE_DIRECTORY/bin/apr-1-config --with-apr-util=/YOUR_APACHE_DIRECTORY/bin/apu-1-config --with-berkeley-db=/opt/lib make & make install

Trouble shooting:
If you experienced with undefined symbol: REP_CACHE_DB_SQL
Then vi subversion/libsvn_fs_fs/rep-cache-db.h alter REP-CACHE-DB_SQL to REP_CACHE_DB_SQL.
This bug was something wrong when generate rep-cache-db.h

Change the working directory to source code for PHP5.4**

./configure --prefix=/path_to_you_preferred --with-icu-dir=/YOUR_ICU_DIRECTORY/icu4 --with-apxs2=/share/YOUR_APACHE_DIRECTORY/bin/apxs --with-mysql=/mnt/ext/opt/mysql --with-pdo-mysql=/mnt/ext/opt/mysql --libdir=/share/MD0_DATA/.qpkg/Optware/lib --includedir=/share/MD0_DATA/.qpkg/Optware/include make && make install vi /YOUR_APACHE_DIRECTORY/conf/httpd.conf

Make sure you have following modules loaded

LoadModule dav_module modules/ LoadModule dav_svn_module modules/ LoadModule authz_svn_module modules/ LoadModule php5_module modules/

AddType application/x-httpd-php-custom .php

SetHandler application/x-httpd-php

change your user group to in httpd.conf

create an alias for usvn

Alias /usvn /USVN_FOLDER/public Options +SymLinksIfOwnerMatch AllowOverride All Order allow,deny Allow from all

Follow the installation guide usvn to complete the installation.