Installing Transmission with Clutch WebUI

Transmission is a fast, easy, and free multi-platform BitTorrent client with a focus on being lightweight yet feature-packed.

» Learn More

Contents [hide]

  1. Install PHP
    1. Build Libxml
    2. Build PHP
    3. Configure Lighttpd
    4. Testing
  2. Install OpenSSL
    1. Build OpenSSL
  3. Install Pkg-Config
    1. Build Pkg-Config
  4. Install Transmission
    1. Build Transmission
    2. Install Clutch
    3. Configure Clutch and Transmission
      1. Socket Settings
      2. Auto Start/Stop
      3. Auto Startup/Shutdown
  5. FAQ

1. Install PHP

1.1. Build libxml

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

1.2. Build PHP

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...

1.3. Configure Lighttpd

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

1.4. Testing

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.

2. Install OpenSSL

This package is required and so must be installed.

2.1. Build OpenSSL

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

3. Install Pkg-Config

This package is required and so must be installed.

3.1. Build Pkg-Config

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

4. Installing Transmission

First of all, you MUST set the following path:

export PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig/

4.1. Install Transmission Daemon

Find your latest version: http://download.m0k.org/transmission/

# wget http://download.m0k.org/transmission/files/transmission-1.03.tar.bz2
# tar jxvf transmission-1.03.tar.bz2
# cd transmission-1.03

Now configure and install.

# ./configure --disable-gtk
# make
# make install

4.2. Install Clutch

Download and install the Web Interface for Transmission.

# cd /usr/www/lib/
# wget http://clutchbt.com/Files/Clutch-0.4.tar.gz
# tar -xvf Clutch-0.4.tar.gz
# mv Clutch-0.4 Clutch
# chmod -R 777 Clutch/
# rm Clutch-0.4.tar.gz

4.3. Configuring Clutch and Transmission

4.3.1. Socket Settings

Edit the socket path file.

# cd Clutch
# vi remote/data/socket.txt

Insert the path to the socket file.

/tmp/transmission.socket

Save and close socket.txt.

Start the daemon by executing this command:

# transmission-daemon -s /tmp/transmission.socket

You can see if transmission-deamon is running:

# ps aux | grep transmission-daemon
root 813 0.0 2.8 1840 856 ? S 11:28 0:01 /usr/local/bin/transmission-daemon -s /tmp/transmission.socket root 816 0.0 2.8 1840 856 ? S 11:28 0:00 /usr/local/bin/transmission-daemon -s /tmp/transmission.socket root 817 0.0 2.8 1840 856 ? S 11:28 0:00 /usr/local/bin/transmission-daemon -s /tmp/transmission.socket

You need to create a symlink as below for transmission-remote to set the download path.

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

Check that socket points to the transmission socket (socket -> /tmp/transmission.socket)

# ls -l

Now set the download path of the remote daemon.

# transmission-remote -f /shares/internal/PUBLIC/

Now go to http://<MyBook-IP>/Clutch and set your torrent download directory.

Saving Clutch preferences creates pref.txt in the same directory as remote/data/socket.txt.

If at this point transmission-daemon is not running, 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 :

[root@mybookworld /]# cd /tmp/
[root@mybookworld tmp]# ls -l -a transmission.socket
srwxrwxrwx 1 root www-data 0 Dec 22 20:06 transmission.socket

[root@mybookworld tmp]# cd /usr/www/lib/torrents/remote/data/
[root@mybookworld data]# ls -l -a socket.txt
-rwxrwxrwx 1 501 501 25 Dec 21 16:14 socket.txt

4.3.2. Auto start/stop

To start transmission automatically with all correct permissions, create a simple shell script.

# cd /etc/init.d
# vi transmission.sh

Add the following into the file:

#!/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
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/
                ;;
        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

Run it like this: /etc/init.d/transmission.sh start

4.3.3. Auto Startup/Shutdown

Edit the file post_network_start.sh.

Change this:

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

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

to this:

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
}

Save, close and reboot the mybook.

This concludes the guide for installing Transmission with Clutch WebUI.

5. FAQ

Q: The Transmission daemon does not appear to be running.

Q: Connection failed. Could not connect to the server.

Q: Password-protect the webpage?

Q: Transmission 0.96 compile error