17
Mar
written by cail.cn • posted in How-To • 6,577 views 7 comments

MyBook World NAS is a wonderful product. Very cheap, comparing with ReadyNAS or Synology. Although the maximum speed is around 4M/sec in a gigabyte network. But, after enabling the ssh function (follow Martin’s firmware update method), the door to a low power consumption linux server is open.

I enabled the ipkg packages by installing optware. I also tried to follow the instruction here to help hard drive keeping cool and silent, although the light control is not working well with the 2.00.15 firmware. It was working with the old firmware. I enabled the rsync server by inserting /etc/services with

rsync 873/tcp

and /etc/inetd.conf with

rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon

.

I tried mldonky, a very powerful donkey network client. It consumes too much power and drags the system extremely slow. I tried to set up a CUPS server, however did not work. Since the new firmware does not include the gcc anymore, I cannot build the any packages now. I had compare the files between 01.01.18 and 02.00.15 as other people did, and copied the 01.01.18 gcc related files back to the new enviroment. Somehow, it just did not work. Also, some program I compiled before can not install now, such as the transmission. So, I had to use ipkg and followed both mybook-linux.co.nr and Synology‘s instructions to install transmission+clutch. Before going to the details, I just want to point out that mybook-linux.co.nr’s instruction is very good for 01.01.18 firmware, not practical for 02.00.15 firmware, due to the lack of gcc make environment. On the other side, Synology’s wiki page has the basic software install steps, but not very detailed configuration part. I also tried very hard to let transmission work just with the built in cgi interface by installing thttpd as illustrated in ReadMe. No luck for me though.

The solution is installing transmission using ipkg/optware, and configure clutch as transmission’s web interface.

1. Install libxml2, php, php-fcgi, etc by

ipkg install transmission php php-fcgi

.
I did ipkg libxml2 openssl pkgconfig before I found out the synology’s page. So if ipkg gets errors, trying to install the libraries first.

2. Configure the built in lighttpd server configure by

nano /etc/lighttpd/lighttpd.conf

(I have ipkged the system with nano and screen for convience), and uncomment the “mod_fastcgi” by removing the # at the beginning of the line (I cannot remember whether the original configure file disabled it or not). and add somthing to end of a part has

fastcgi.server    = ( ".pl" =>

and

"nasMaster.pl" => ((  "socket" => "/tmp/lighttpd.fcgi.socket",

.
I added , to )), and

".php" => ((
                  "socket" => "/tmp/php-fcgi.sock",
                  "bin-path" => "/opt/bin/php-fcgi",
                  "bin-environment" => ("PHP_FCGI_MAX_REQUESTS" => "4000"
                                        )
               ))

before the )) and the final ).
I also expaned the index-file part to

index-file.names = ( "nasMaster.pl", "index.html", "index.htm", "index.php", "default.html", "default.htm")

.

3. Restart the server by

# /etc/init.d/lighttpd.sh restart

.
Everything should be good. If not, please check the error message and google/fix it.

4. Test the server by

nano /usr/www/lib/test/index.php

with

<?php phpinfo(); ?>

You may need

mkdir -p /usr/www/lib/test

and point the browser to http://mybookworld/test to confirm the php is running

5. Create a folder in /usr/www/lib with the name of clutch, and contents from

wget http://clutchbt.com/Files/Clutch-0.4.tar.gz

.
I also

chmod -R 777 clutch/

(which may not be necessary). Configure clutch by

nano /usr/www/lib/clutch/remote/data/socket.txt

with

/tmp/transmission.socket

.

6. Configure the transmission by

nano /opt/etc/transmission.conf

.
I only edited the port. The transmission.conf file is very well self-explained. You could also consider the Synology’s setting.

PIDFILE=/opt/var/run/transmission.pid
ACTIVE=/root/active-torrents.txt
HOME=/root/.transmission

7. Start transmission daemon by

transmission-daemon -s /tmp/transmission.socket

.
Check it by

ps aux | grep transmission-daemon

(three processes are expected)

8. Create a symlink for transmission-remote to set the download path.

cd /root/.transmission/daemon
ln -s /tmp/transmission.socket socket

Now set the download path and the listening port of the remote daemon. (The port has been set in transmission.conf file. I just want to be sure, because my box is behind a firewall.)

transmission-remote -f /shares/internal/PUBLIC/ <strong>-p 8888</strong>

9. Things should be rocking at http://mybookworld/clutch/.
To autostart the service,

nano /etc/init.d/transmission.sh

and

chmod +x /etc/init.d/transmission.sh
#!/bin/sh
#
# Copyright (C) 2007 JRM
#
# Starts or stops the transmission daemons.
# Writes directory permissions and changes owner for
# the transmission.socket.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin
NAME="Transmission"
DESC="torrent daemon"
case "$1" in
        start)
                echo -n "Starting $DESC: "
                transmission-daemon -s /tmp/transmission.socket
                echo "$NAME."
                sleep 2
                chmod -R 777 /tmp/transmission.socket
                chown -R www-data:www-data /tmp/transmission.socket
                sleep 2
                transmission-remote -f /shares/internal/PUBLIC/ -p 8888
                ;;
        stop)
                echo -n "Stopping $DESC: "
                killall transmission-daemon
                echo "$NAME."
                ;;
        *)
                N=/etc/init.d/$NAME
                echo "Usage: $N {start|stop}" >&2
                exit 1
                ;;
esac
exit 0

With the help of a modified /etc/init.d/post_network_start.sh file,

start() {
	if [ ! -e "$POST_NETWORK_STARTED_FILE" ]
	then
		$SCRIPTS_PATH/crond.sh start
#		$SCRIPTS_PATH/mionet.sh start
		$SCRIPTS_PATH/transmission.sh start
		touch $POST_NETWORK_STARTED_FILE
	fi
}
stop() {
	if [ -e "$POST_NETWORK_STARTED_FILE" ]
	then
		$SCRIPTS_PATH/transmission.sh stop
#		$SCRIPTS_PATH/mionet.sh stop
		$SCRIPTS_PATH/crond.sh stop
		rm $POST_NETWORK_STARTED_FILE
	fi
}

We are in business now! Good luck.

Leave a Reply

 

En.dogeno.us - CaiLog © cail.cn | Licensed under a Creative Commons License