Transmission is a fast, easy, and free multi-platform BitTorrent client with a focus on being lightweight yet feature-packed.
Clutch web page: http://clutchbt.com/
Transmission web page: http://transmission.m0k.org
PHP web site: http://nl2.php.net/
Apache 2 and PHP 5: http://dan.drydog.com/apache2php.html
Libxml is required by PHP so is needed.
Find your latest version: http://ftp.gnome.org.
# cd /tmp/myfiles/ # wget http://ftp.gnome.org/pub/gnome/sources/libxml2/2.6/libxml2-2.6.27.tar.gz # tar xfz libxml2-2.6.27.tar.gz # cd libxml2-2.6.27 # ./configure # make # make install
PHP needs a copy of libxml2 in the /lib/ directory.
# cp /usr/local/lib/libxml2.so.2 /lib
Find your latest version: http://be2.php.net.
# cd /tmp/myfiles/ # wget http://uk.php.net/distributions/php-5.2.5.tar.gz # tar xvfz php-5.2.5.tar.gz # cd php-5.2.5 # ./configure —without-iconv —without-pear —enable-fastcgi —enable-discard-path —enable-force-cgi-redirect —without-mysql —enable-sockets # make # make install
You can also do a make test to run an extensive test on PHP...
You can read a tutorial here: http://trac.lighttpd.net/trac/wiki/TutorialLighttpdAndPHP
You need to edit lighttpd's config file as follows:
# cd /etc/lighttpd
Make a backup in case you mess up.
# cp lighttpd.conf lighttpd.conf.backup
Edit lighttpd.conf and replace this:
“nasMaster.pl” => (( “socket” => “/tmp/lighttpd.fcgi.socket”,
“check-local” => “disable”,
))
)
with this:
“nasMaster.pl” => (( “socket” => “/tmp/lighttpd.fcgi.socket”,
“check-local” => “disable”,
)),
“.php” => (( “bin-path” => “/usr/local/bin/php-cgi”,
“socket” => “/tmp/php.socket”,
))
)
Change the line that reads:
index-file.names = ( "nasMaster.pl" )
with this:
index-file.names = ( "nasMaster.pl", "index.html", "index.php" )
After you make these changes, you need to restart lighttpd:
# /etc/init.d/lighttpd.sh restart
Now to test PHP with a simple webpage.
# cd /usr/www/lib # mkdir test # cd test # vi index.php
Enter this line below into index.php.
<?php phpinfo(); ?>
Browse to http://<MyBook-IP>/test/index.php You should see all the information about the PHP installation.
This package is required and so must be installed.
Find your latest version: http://www.openssl.org.
# cd /tmp/myfiles/ # wget http://www.openssl.org/source/openssl-0.9.8g.tar.gz # tar -xvf openssl-0.9.8g.tar.gz # cd openssl-0.9.8g/ # ./configure # make # make install
This package is required and so must be installed.
Find your latest version: http://pkgconfig.freedesktop.org.
# cd /tmp/myfiles/ # wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.22.tar.gz # tar -xvf pkg-config-0.22.tar.gz # cd pkg-config-0.22/ # ./configure # make # make install
First of all, you MUST set the following path:
export PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig/
Find your latest version: http://download.m0k.org/transmission/
# wget http://download.m0k.org/transmission/files/transmission-1.01.tar.bz2 # tar jxvf transmission-1.01.tar.bz2 # cd transmission-1.01
Now configure and install.
# ./configure --disable-gtk # make # make install
Building Transmission from SVN (First Time):
# svn co svn://svn.m0k.org/Transmission/trunk Transmission # cd Transmission # ./autogen.sh # ./configure --disable-gtk # make # make install
Building Transmission from SVN (Updating):
# cd Transmission # svn up # make # make install
Download and install the Web Interface for Transmission.
# cd /usr/www/lib/ # wget http://clutchbt.com/Files/Clutch-0.2.tar.gz # tar -xvf Clutch-0.2.tar.gz # mv Clutch-0.2 Clutch # chmod -R 777 Clutch/ # rm Clutch-0.1.tar.gz
Put a soft-link to the /usr/www/lib/ path:
# ln -s /shares/internal/PUBLIC/http-server/Clutch/ /usr/www/lib/
Now edit the socket path, and point it to your server root dir ...
# cd Clutch # nano remote/data/socket.txt
Point it to your server root dir ...
/root/.transmission/daemon/socket
Save and close socket.txt.
You start transmission with "transmission-daemon -s /root/.transmission/daemon/socket"
You can add torrents and change prefs from the webui.
# transmission-daemon -s /root/.transmission/daemon/socket
You can see if transmission-deamon is running:
# ps aux | grep transmission-daemon root 2721 0.1 16.1 8364 4852 ? S Dec01 2:57 transmission-daemon -s /root/.transmission/daemon/socket root 2722 0.0 16.1 8364 4852 ? S Dec01 0:00 transmission-daemon -s /root/.transmission/daemon/socket root 2723 26.0 16.1 8364 4852 ? R Dec01 766:27 transmission-daemon -s /root/.transmission/daemon/socket
Now set the download path of the remote daemon:
# transmission-remote -f /shares/internal/PUBLIC/torrent/
Now go to http://<MyBook-IP>/Clutch and start downloading ...
If at this point transmission-daemon is not running, or giving errors, or your Clutch webui is giving errors,
probably some of your file or directory permissions are not correct.
Here are my permission settings :
.transmission/daemon/socket : [root@MyBookWorld ~]# ls -l -a .transmission/daemon/socket drwxrwxrwx 2 www-data www-data 4096 Dec 3 14:27 . /shares/internal/PUBLIC/http-server/Clutch : [root@MyBookWorld ~]# ls -l -a /shares/internal/PUBLIC/http-server/ drwxrwxrwx 6 www-data www-data 4096 Oct 25 05:45 Clutch
Looks to me they are all set to the user www-data.
To start transmission automatically with all correct permissions, create a simple shell script.
# cd /etc/init.d # nano transmission
Add the following into the file:
#!/bin/sh
#
# Copyright (C) 2007 Bart Franco
#
# 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
NAME="transmission"
DESC="BitTorrent client"
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
transmission-daemon -s /root/.transmission/daemon/socket
echo "..."
sleep 4
chmod -R 777 /root/.transmission
chown -R www-data:www-data /root/.transmission
sleep 3
# Setting torrent download directory (not working in Clutch/Preferences yet)
transmission-remote -f /shares/internal/PUBLIC/torrent/
sleep 1
ps aux | grep transmission-daemon
;;
stop)
echo -n "Stopping $DESC: $NAME"
killall transmission-daemon
echo "."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop}" >&2
exit 2
;;
esac
exit 0
Run it like this: /etc/init.d/transmission start
And run the following to have it startup and stop on system start/shutdown.
Give transmission its access rights. Then make a symbolic link to
stop the service when the MBWE is shutting down.
# cd /etc/init.d # chmod 0700 /etc/init.d/transmission # chown root:root /etc/init.d/transmission # ln -s /etc/init.d/transmission S98transmission # ln -s /etc/init.d/transmission K03transmission
The scripts in the directory/etc/init.d/starting withS[number]are automatically run during system startup with parameterstart.
The number defines the order the scripts are run.
Likewise, scripts starting withK[number]are run when the system is shutting down with parameterstop.
I love the idea of being at work an just letting my HD what to download and when.
Its a great concept, however I was wondering if there was any way I could password protect the clutch gui.
I'd like to somehow authenticate before it lets me mess around with it.
I'd hate for someone to portscan me and mess with all my torrents when I'm away.
Add the following to your /etc/lighttpd/lighttpd.conf file to set auth on your Clutch directory:
auth.require = ( "/auth" =>
(
"method" => "digest",
"realm" => "nas admin",
"require" => "valid-user"
# bruce - removed user=
# "require" => "user=admin"
),
"/Clutch/" =>
(
"method" => "digest",
"realm" => "nas admin",
"require" => "valid-user"
)
This will use the same password you use to access your Mybook Webinterface.