what i have:
→ QNAP TS-121
what we need:
- putty → a terminal → every time you see “#” you need putty
- winSCP → an “file-explorer”
What we will do:
1. installing packages for compiling
1a) optware IPKG
1b) installing necessary packages for compiling
1c) edit the Optware.sh
2. installing missing packages for urbackup
2a) creating temp and install directory
2b) installing missing packages for urbackup
2bb) crypto++
2bbb) libcurl & libcurl-dev
3. installing urbackup-server
3a) download the source-code and unzip
3b) we set the “install-dir” with prefix
3c) compiling (make)
3d) edit the MAKEFILE
3e) make install
3f) edit the “start_urbackup_server”
4. Testing
4a) starting urbackup-server
4b) test if it works
4c) config the “backup-dir”
5. Autostart urbackup-server at startup
5a) create an “autorun.sh”
5b) edit the “qpkg.conf”#
---------------------------------------------LET US BEGIN-------------------------------
1. installing packages for compiling
1a) optware IPKG
→ go to the app-center on your qnap and install the optware IPKG
1b) installing necessary packages for compiling
→ for compiling the source code for urbackup we need some packages
→ logon with putty on your nas and type the following:
# ipkg update
# ipkg install libidn getopt unzip optware-devel
1c) edit the Optware.sh
Fix the $PATH in “/etc/profile”
→ you can edit the Optware.sh with winSCP → go to
and open the
Look for the section of code which mentions
Replace it so that this part of the file looks like:
# adding Ipkg apps into system path ...
/bin/cat /etc/profile | /bin/grep "PATH" | /bin/grep "/opt/bin" 1>>/dev/null 2>>/dev/null
# Bug fix for following: put IPKG first, per http://forum.qnap.com/viewtopic.php?f=124&t=15663
# was [ $? -ne 0 ] && /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc/profile
[ $? -ne 0 ] && /bin/echo "export PATH=/opt/bin:/opt/sbin:\$PATH" >> /etc/profile
save the file.
reboot the QNAP NAS and check – in admin shell (putty) – the $PATH environment : variable “ /opt/bin” and “/opt/sbin” should come before “/bin” and “/usr/bin”. For instance:
# echo $PATH
/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/sbin
2. installing missing packages for urbackup
2a) creating temp and install directory
→ in the temp dir i will download the necessary source-code for compiling
→ Because my Qnap (121) has not enough space at “system-dir” i will use my “own” install dir for urbackup
→ the temp and install dir are now FIX!!! if you want anothe location for the temp and install dir you have adapt every time where you find my temp and install dir @ your own
temp dir:
with winSCP go to
[quote=“”]/share/HDA_DATA/[/quote]
create a
install dir:
with winSCP got to
[quote=“”] /share/HDA_DATA/[/quote]
create
in urbackup dir create an install dir and an backup dir
it shuld look like this:
/share/HDA_DATA/
…temp
…urbackup
,install
,backups
2b) installing missing packages for urbackup
→ for compiling the source-code of urbackup successful we need some package
→ the crypto++ package need do be compiled and installed
2bb) crypto++
with putty type the following:
# cd /share/HDA_DATA/temp
# mkdir cryptopp
# cd cryptopp
download the source-code for crypto++ → the make will take a while ←
# wget http://prdownloads.sourceforge.net/cryptopp/cryptopp562.zip
# unzip cryptopp562.zip
# rm -r cryptopp562.zip
# make -f GNUmakefile
# make libcryptopp.a libcryptopp.so
# make install
→ if there comes an error message, with cryptest.exe (not enough space) → thats no problem
→ now you can delete the cryptopp folder in your temp
# rm -r /share/HDA_DATA/temp/cryptopp
2bbb) libcurl & libcurl-dev
# ipkg update
# ipkg install libcurl
# ipkg install libcurl-dev automake
REBOOT the system now
# reboot
3. installing urbackup-server
3a) download the source-code and unzip
→ with putty go to the temp dir
# cd /share/HDA_DATA/temp
download the source-code for urbackup
# wget http://sourceforge.net/projects/urbackup/files/Server/1.2.3/urbackup-server-1.2.3.tar.gz/download
# tar xzf urbackup-server-1.2.3.tar.gz
# rm urbackup-server-1.2.3.tar.gz
# cd urbackup-server-1.2.3.261/
3b) we set the “install-dir” with prefix
----------------------PREFIX----------------
→ we use the prefix to install urbackup on a place we want
→ because at my qnap is not enough space @ the “system directory”
→ this will install urbackup @ /share/HDA_DATA/urbackup/install/
→ the following command will check your qnap if all dependings are installed
# ./configure --prefix /share/HDA_DATA/urbackup/install/
→ when there was[color=#FF0000] NO ERROR-MESSAGE [/color] then we can compile the source-code
3c) compiling (make)
→ this will take a very long time–> go for lunch or coffe
# make
3d) edit the MAKEFILE
→ we have to edit the make file, because the “adduser” command will not work
→ go with winSCP to
[quote=“”]/share/HDA_DATA/temp/urbackup-server-1.2.3.261/[/quote]
and edit the[quote=“”]MAKEFILE[/quote]
→ go to the buttom and search for the following line:
adduser urbackup --system --quiet --group --home "$(DESTDIR)$(localstatedir)/urbackup" || true
→ and comment it out with #, so that it look like this:
###adduser urbackup --system --quiet --group --home "$(DESTDIR)$(localstatedir)/urbackup" || true
3e) make install
→ now we can “install” urbackup @ QNAP
→ All files shoud be installe @ /share/HDA_DATA/urbackup/install/
# make install
3f) edit the “start_urbackup_server”
→ go with winSCP to
[quote=“”] /share/HDA_DATA/urbackup/install/sbin/ [/quote]
→ edit the[quote=“”] “start_urbackup_server” [/quote]
search for:
PREFIX=/usr
replace with:
PREFIX=/share/HDA_DATA/urbackup/install
search for:
DAEMON_DIR="/var"
replace with:
DAEMON_DIR="/share/HDA_DATA/urbackup/install/var"
SAVE FILE!!!
4. Testing
4a) starting urbackup-server
with putty go to the install dir
# cd /share/HDA_DATA/urbackup/install/sbin
# ./start_urbackup_server
4b) test if it works
—> open your browser and type:
→ now you should see the webAdminPagePage
4c) config the “backup-dir”
→ under Settung you should set the location where urbackup-server should save the “BACKUPS”
→ i set: [quote=“”]/share/HDA_DATA/urbackup/backups/[/quote]
5. Autostart urbackup-server at startup
5a) create an “autorun.sh”
→ [color=#FF4040]REMEMBER to adapt these lines if you use another location of your “install path”[/color]
→ I make some [color=#008000]“variables” [/color]–> there you can place your “install path”
→ with winSCP go to:
[quote=“”]/share/HDA_DATA/urbackup/install/sbin[/quote]
→ create the file:
[quote=“”]autorun.sh[/quote]
→ enter the following line into the “autorun.sh” file
#!/bin/sh
[color=#008000]PIDFILE="/var/run/urbackup_srv.pid"
LOGFILE="/var/log/urbackup.log"
HTTP_PORT=55414
FASTCGI_PORT=55413
INSTALL_DIR="/share/HDA_DATA/urbackup/install"
LIB_DIR="$INSTALL_DIR/lib"[/color]
start()
{
## go to the /var dir --> this is neccessary if you start urbackup_srv
cd /share/HDA_DATA/urbackup/install/var
## start the urbackp_srv with plugins
/share/HDA_DATA/urbackup/install/sbin/urbackup_srv --daemon --http_port $HTTP_PORT --logfile $LOGFILE --pidfile $PIDFILE --plugin $LIB_DIR/liburbackupserver_urlplugin.so --plugin $LIB_DIR/liburbackupserver_cryptoplugin.so --plugin $LIB_DIR/liburbackupserver_downloadplugin.so --plugin $LIB_DIR/liburbackupserver_fsimageplugin.so --plugin $LIB_DIR/liburbackupserver_httpserver.so --plugin $LIB_DIR/liburbackupserver.so --http_root $INSTALL_DIR/var/urbackup/www --workingdir $INSTALL_DIR/var --user urbackup --snapshot_helper $INSTALL_DIR/bin/urbackup_snapshot_helper
}
stop()
{
#echo "Shutting down "
kill `cat $PIDFILE`
rm -f $PIDFILE
sleep 5
}
# you do not need to edit this lines
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
# Restarting the Daemon
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
make the [quote=“”]“autorun.sh”[/quote] executable → press[quote=“”] F9[/quote] and set the permission to [quote=“”]0755[/quote]
[u]
5b) edit the “qpkg.conf”[/u]
→ with winSCP goto
[quote=“”]/etc/config/[/quote]
→ edit the[quote=“”] “qpkg.conf”[/quote]
→ the [color=#FF4000]SHELL[/color] and the [color=#FF4000]INSTALL_PATH[/color] are the important lines
→ at the end of the line enter these following lines!! [color=#FF4040]REMEMBER to adapt these lines if you use anothe location of your “install path”[/color]
[urbackup]
Name = urbackup
Version = 0.1
Author = escctrl
Date = 2013-20-08
Shell = /share/HDA_DATA/urbackup/install/sbin/autorun.sh
Install_Path = /share/HDA_DATA/urbackup/install/sbin
Enable = TRUE
→ now reboot your QNAP and urbackup server shuld be autostart
[size=28]–>FINISH<—[/size]