Install BitTorrent client BTG and its Web user interface wwwBTG on Debian 4.0 Etch
BTG is a BitTorrent client that work as a daemon. It can be controlled by various interfaces, one of them is a Web interface written in PHP. It is a serious competitor to Torrentflux-B4rt, the BitTorrent client that i'm using for the moment. This article help you to install BTG on Debian 4.0 Etch.
First, we install BTG build dependencies:
/usr/bin/apt-get install wget build-essential libgnutls-dev libboost-iostreams-dev libboost-filesystem-dev \
libboost-date-time-dev libboost-thread-dev libboost-program-options-dev libssl-dev \
pkg-config libexpat1-dev dialog libncurses5-dev libboost-serialization-dev libboost-regex-dev
We also need to install a HTTP server with PHP 5 support. In order to do this, you can follow my guide Install Lighttpd and PHP 5 on Debian 4.0 Etch.
Building Rasterbar libtorrent
We choose the version we are willing to install:
VERSION=0.12
We download the sources archive:
/usr/bin/wget http://switch.dl.sourceforge.net/sourceforge/libtorrent/libtorrent-$VERSION.tar.gz \
--output-document=/tmp/libtorrent-$VERSION.tar.gz
We extract the sources:
/bin/tar --directory=/tmp -xzf /tmp/libtorrent-$VERSION.tar.gz
And we go to the created folder:
cd /tmp/libtorrent-$VERSION
We configure the sources:
./configure
We build the library:
/usr/bin/make
And we install it:
/usr/bin/make install
BTG building
We choose the BTG version we are willing to install:
VERSION=0.9.7
We download the sources archive:
/usr/bin/wget http://download.berlios.de/btg/btg-$VERSION.tar.gz \
--output-document=/tmp/btg-$VERSION.tar.gz
We extract the sources:
/bin/tar --directory=/tmp -xzf /tmp/btg-$VERSION.tar.gz
And we go to the created folder:
cd /tmp/btg-$VERSION
We configure BTG to be installed with Web UI, session saving, script callback on event, and command line interface:
./configure --enable-www --enable-session-saving --enable-event-callback --enable-cli
We build BTG:
/usr/bin/make
And we install:
/usr/bin/make install
Setup
First, we install the Web interface:
/bin/ln -s /usr/local/share/wwwbtg/htdocs/ /var/www/btg
Once this done, we install daemon configuration file:
/bin/mkdir /etc/btg
/usr/bin/wget http://howto.landure.fr/gnu-linux/debian-4-0-etch/installer-btg-et-son-interface-web-wwwbtg-sur-debian-4-0-etch/daemon.ini \
--output-document=/etc/btg/daemon.ini
We download the daemon init.d script:
/usr/bin/wget http://howto.landure.fr/gnu-linux/debian-4-0-etch/installer-btg-et-son-interface-web-wwwbtg-sur-debian-4-0-etch/btgdaemon \
--output-document=/etc/init.d/btgdaemon
/bin/chmod +x /etc/init.d/btgdaemon
We create the btg user that the daemon will run under:
/usr/sbin/adduser --home /var/lib/btg --no-create-home --disabled-login --disabled-password --system --group btg
We create the log file:
/usr/bin/touch /var/log/btg.log
/bin/chown -R btg:btg /var/log/btg.log
We create the BTG downloads directory:
/bin/mkdir /var/lib/btg
/usr/bin/touch /var/lib/btg/sessions.ini
/bin/chown -R btg:btg /var/lib/btg
User creation
Once every thing is ok, we create the users. In order to do this, choose the username you wan to use:
USERNAME=login
And use these command lines to create the user:
/bin/mkdir --parent /var/lib/btg/users/$USERNAME/temp
/bin/mkdir --parent /var/lib/btg/users/$USERNAME/work
/bin/mkdir --parent /var/lib/btg/users/$USERNAME/seed
/bin/mkdir --parent /var/lib/btg/users/$USERNAME/dest
/bin/chown -R btg:btg /var/lib/btg/users/$USERNAME
/usr/local/bin/btgpasswd --config /etc/btg/daemon.ini --create --add \
--temp /var/lib/btg/users/$USERNAME/temp \
--work /var/lib/btg/users/$USERNAME/work \
--seed /var/lib/btg/users/$USERNAME/seed \
--dest /var/lib/btg/users/$USERNAME/dest \
--password --username $USERNAME
Controlling BTG
To start BTG daemon, use:
/etc/init.d/btgdaemon start
To stop it, use:
/etc/init.d/btgdaemon stop
If you want BTG daemon to start when your computer start, use this command line:
/usr/sbin/update-rc.d btgdaemon defaults
Used ports
If you want to edit the ports used by btgdaemon for the BitTorrent download (9000 to 9100), you just need to modify the following line into the file /etc/btg/daemon.ini:
torrent-range=9000:9100
Using BTG
Once the daemon is started, you can access your BTG web interface by using this URL:
Note: If BTG does not fit your needs, I encourage you to try Torrentflux-B4rt that do the same thing, but in another way. In order to do this, I invite you to follow my guide Install Torrentflux-b4rt on Debian 4.0 Etch.
Thanks
Thanks!
It's also useful to put the adduser commands into a shell script if your going to make a few, eg /etc/btg/adduser.sh
#!/bin/bash
USERNAME=$1
/bin/mkdir --parent /var/lib/btg/users/$USERNAME/temp
/bin/mkdir --parent /var/lib/btg/users/$USERNAME/work
/bin/mkdir --parent /var/lib/btg/users/$USERNAME/seed
/bin/mkdir --parent /var/lib/btg/users/$USERNAME/dest
/bin/chown -R btg:btg /var/lib/btg/users/$USERNAME
/usr/local/bin/btgpasswd --config /etc/btg/daemon.ini --create --add \
--temp /var/lib/btg/users/$USERNAME/temp \
--work /var/lib/btg/users/$USERNAME/work \
--seed /var/lib/btg/users/$USERNAME/seed \
--dest /var/lib/btg/users/$USERNAME/dest \
--password --username $USERNAME
change user or default rights
owner ship
- add the users that need to access the files to the "btg" group. (this is the clean way, but i don't know if it will work).
- Create a cron job to change ownership of btg files.
change user or default rights
the cron job is like you say not a clean way, but it will work.
Is it not possible to run the daemon under an other user? than the downloaded files will have an other owner.
if that is possible i can run the daemon under the same user as i use to access my files with.
thanks!
Leon
it is possible
I think you should stick to the cron job.
url downloading?
error: AJAX call failed, no XML DOM returned! Data: <br />
<b>Fatal error</b> undefined class constant 'CN_CURLSTATUS' in /usr/local/share/wwwbtg/htdocs/bcore/command/context_create_url.php on line 133
if i refresh the page manually it will start the download, and i can add another torrent and all is well, how do i prevent this message and allow for additional torrents after the 1 is loaded? also, amazing work on this site!
any ideas?
curl is missing
sudo apt-get install php5-curl
/etc/init.d/lighttpd force-reload
good luck
fccfxxoc
bvccltsf
vglehukq
leaqhqbe
gtkmm
works great whit my Debian Etch.
Is possible use the GTKmm for controlled Daemon ?
Thanks again for your work.
Marc
GTKmm ?
Good luck
UI
I'm a noob in Linux.
I was looking for a guide for how to install
IU on BTG, this client i think is very good!
Usually i use rtorrent from the shell
whit my server, not OVH :D but anyway have speed 100/100 :D
but I was intrigued to try BTG, and your guide was really well done.
even compliments.
If you know a link where explains how to install IU in BTG, i'm very grateful.
Excuse my Off Topic, and thanks again for your attention.
Marc
don't know
Good luck
(ps: may be adding --enable-gui to the configure command line can do the trick... but i'm just guessing here).
--enable-gui
I read the "how to" section and thanks for your suggestion.
but my english is poor :(
I can add the command:
./ configure --enable-gui
but i must install before gtkmm?
Thanks.
Marc
poor english ?
This site is mainly french, so there is a french version of the btg gui... and on my own i'm a french guy :)
As for what you need to install BTG, i've no idea, since i don't use this software outside of a server, since i find transmission fine for my desktop needs.
Now i use wTorrent as webgui to rtorrent (but it is a pain to install).
IP
Thanks for reply.
Yes , i'm not french , if u are admin of site , can see my IP !
Marc ....is Marco :)
Anyway thanks for great work (u explain very well )
if u want to explain how to install Wtorrent , this is a great step !
becouse i'm fans of rtorrent and seedbox !(i guess u know what this is )
i tested WWWbtg , and the speed is very poor ! (i have tested on FTN )
thanks again.
if u whant contact me :
underscore72@hotmail.it
ldconfig
Don't forget to run:
sudo ldconfig
after make install for btg.
Alex