Table of Contents
This howto describes building, configuring and using the BTG daemon and the available clients.
The following software should be installed before attempting to build BTG.
Create a directory used for compiling.
# mkdir ~/btg-devel
Fetch BTG from CVS.
# cvs -d:pserver:anonymous@cvs.btg.berlios.de:/cvsroot/btg login
# cvs -z3 -d:pserver:anonymous@cvs.btg.berlios.de:/cvsroot/btg co -r devel-branch btg
Generate the build system.
# cd ~/btg-devel/btg
# ./autogen.sh
Now run configure to create either a release or debug build.
# ./configure --enable-all
or
# ./configure --enable-all --enable-debug --enable-unittest
The above command will enable writing extensive debug information and build unittests, which can be executed using:
# make check
after a completed build.
Execute make to build BTG.
# make
# make install
The above command will install BTG to the default location used by configure. The WWW UI will be installed to PREFIX/share/wwwbtg. The default value of PREFIX is /usr/local.
A template can be found in the /debian directory. This needs adjusting to the debian version used and to which boost version are installed.
Ebuild files contributed by Peter Koeleman are located in the /gentoo directory. These files need to be adjusted to the Rasterbar Libtorrent and BTG versions used.
The applications must be configured before use. They will not work without a correct config file. The following assumes that all configuration files will be located in ~/.btg.
daemon.ini - Place this file in ~/.btg/daemon.ini, which is the default daemon config file location.
The above config sets the daemon to do the following:
When the configuration files are done you will need to create one or more users. This is done with the btgpasswd utility:
# btgpasswd --create -a -t "~/btg/user/username/torrents" -w "~/btg/user/username/work" -d "~/btg/user/username/finished" -s "~/btg/user/username/seeding" -p -u <username>
Use the --create parameter to create a new password file, if it doesnt exist. Enter the password on stdin, then you should get an OK and you are done.
Make sure you create all the directories before you start the daemon.
Before attempting to use any of the clients, follow the instruction in Testing to make sure that the daemon starts and can communicate with clients.
client.ini - Place this file in ~/.btg/client.ini, which is the default client config file location.
The above config makes the clients to do the following:
Configuring PHP:
Make sure that the following is included in the apache config file if you want to run the WWW UI.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Configuring wwwBTG:
The easiest way to access wwwBTG is to create a symlink from your webservers document root to PREFIX/share/wwwbtg/htdocs (see Installation). If no PREFIX was set before installing, wwwBTG should have been installed in /usr/local/share/wwwbtg.
# ln -s /usr/local/share/wwwbtg/htdocs /home/www/btg
Make sure Apache has FollowSymLinks enabled on this directory so it can follow the symlink for wwwBTG.
wwwBTG has a configuration file named config.php. For the moment you dont have to do any changes here unless you run the daemon and the web UI on two different machines.
Surf to http://www.example.com/btg or wherever you placed it, and select your session in the list (or create a new) and press attach, and wwwBTG is ready to use.
Other:
When there are updates in BTG you can run cvs update -dP in ~/btg-devel/ again to download the latest source code, and then you run the autogen-stuff, configure as before and finaly make (you might want to run make clean before this to make sure no conflicts arises).
To stop the daemon just issue a kill in the pid. If you activated sessionsaving all sessions & torrents will be saved when a SIGINT (ctrl-c if you run in foreground) or SIGTERM (default kill signal) is received. When receiving a SIGHUP the password file will be reread.
The following instructions are to ensure that an installation of BTG actually works.
The following command will start the daemon.
# btgdaemon
You can pass the -n parameter so it wont fork into background mode, which is good when testing. -v or -d can also be added for more verbose logging, this helps alot when troubleshooting). To use the daemon you have to use a client, either the CLI-client, the GUI-client or wwwBTG. All three can be used to setup sessions.
# btgcli
This will start the command line client. Most operations can be done from the web interface (see below), but some things are not yet doable (for example, set individual limits on torrents).
You will be requested to enter username and password. If you run without any parameters, you will create a new session which later can be reattached. Write "detach" to detach the session, but leave it running in the daemon (what you normally do). Note that if you write "quit" the session will be terminated! If you like to run the CLI later, you can use the parameter -A to attach to the first available session.
If you find any bugs, please report them using the bugtracker.
Original howto, translated from swedish written by: donnex with help of unclear, and jstrom.