Home > Computer , Linux Admin , Linux Multimedia , Open Source-Free Software > [Help] realize a low-cost servers for mail and sharing files torrent (Part 7)

[Help] realize a low-cost servers for mail and sharing files torrent (Part 7)

If you are interested to be updated on new articles published on this site subscribe to the RSS feed . Thanks for visiting!

Here we are in the penultimate section of this guide. Today we face the 'bittorrent client installed with management on the web. In particular, we will address the installation of libraries Torrent Rasterbar . This is a library written in C + + to exploit the system in a P2P Bittorrent alternative to other solutions. So it is not a client itself, but a library which is then exploited in our case, from a Web client.

If you would install the client on a BTG distribution CentOS GNU / Linux or its derivatives, you can read this article

In the introductory part of this guide I said that I would use torrent client as the famous and popular web TorrentFlux . However, I decided to change and use the client libraries torrent Rasterbar GUI BTG . The main reason for this is practical (for reasons other than saving resources) and is given the opportunity to set an upload speed unique to open all torrents, while TorrentFlux can only set the maximum upload speed for each torrent. I will not explain the technical reasons for this handicap, there is enough to know that with TorrentFlux, per download, open a torrent client with the multiplication of resources used!

That said, we pass the practical part of driving and proceed with the installation of libraries Rasterbar. For the person who made the ' Upgrade from Debian Etch to Lenny on Alix is sufficient to run an apt-get to install the libraries in version 0.13. 1:

# Apt-get install libtorrent-rasterbar0

However, those who have not upgraded must recompile "on hand" because the libraries rasterbar on debian etch version that you download with apt-get is really too old!

After installing the libraries Rasterbar, we can proceed with the 'install packages necessary to compile the client Web BTG:

# Apt-get install build-essential libgnutls-iostreams-dev libboost-dev libboost-filesystem-dev libboost-date-time-dev libboost-threaded-dev libboost-program-options-dev libssl dev-pkg-config libexpat1-dev dialog libncurses5-dev libboost-serialization-dev libboost-regex-dev curl-rasterbar libtorrent-dev php5-curl

The above must be entered on one line :)

Now grab the latest source release of BTG (0.9.9 at the time of writing):

# Cd / tmp
# Wget http://download.berlios.de/btg/btg-0.9.9.tar.gz
# Tar xzvf btg-0.9.9.tar.gz

And proceed with the compilation:

Btg-0.9.9 # cd cd
#. / Configure-enable-www-enable-session-saving-enable-event-callback-enable-cli-enable-command-list-enable-btg-config
# Make
# Make install

If the build should finish with a memory error, you can move the btg-0.9.9 directory on the external drive and make the return from there:

# Mv / tmp/btg-0.9.9 / data /
# Cd / dati/btg-0.9.9
# Make

At this point we start configuring the software. We begin with the creation of the directory where we post the configuration files:

# Mkdir / etc / btg

We continue with the creation of a directory on an external disk (assuming that this is mounted on dir / data) where to put the lists of banned IP, the filter list emule-style sessions and save:

# Mkdir / data / btg

Now we create some files required to operate the daemon on the basis of what you enter in the configuration file that will show daemon.ini below:

# Touch / var / log / btg-torrent.log
# Touch / data / btg / daemon.saved

Proceed with the creation of the configuration file daemon.ini. Edit this file in the dir / etc / btg this:

# Touch / etc / btg / daemon.ini

Open the file you just created using your favorite editor and insert this content:

[Auth]
passwd-file = / etc / btg / passwd
[Transport]
default = xml-rpc
[Network]
listen-to = 0.0.0.0:16000
torrent-range = 10024:10025
[Logging]
type = file
filename = / var / log / btg-torrent.log
[Misc]
banfile = / data / btg / bans
filter = emule
filename = / data / btg / ipfilter.dat
[Savesessions]
enable = true
filename = / data / btg / daemon.saved
timeout = 60
[Limited]
upload_rate_limit = 32000
download_rate_limit = -1
max_uploads = -1
max_connections = -1

The contents of the file speaks for itself and therefore avoid specifying all sections. But I want to clarify that in my case I setup an upload maximum of about 32KB, and I set the usage limit to -1 ... in that it will use the entire upload limit, as if my adsl could have a maximum speed in upload less than 32 KB.

We then create a symbolic link from the content files for the web server to the Apache directory:

# Ln-s / usr / local / share / wwwbtg / htdocs / / data / www / btg

Then, create a user named "BTG" that can use the daemon BTG without special privileges:

# Adduser-home / data / torrent-no-create-home disabled-login-password-disabled-system-group-btg

And again, we begin with the creation of directories and a user who can use the web client:

# Mkdir-parent / data / torrents / stefano / temp
# Mkdir-parent / data / torrents / stefano / work
# Mkdir-parent / data / torrents / stefano / seed
# Mkdir-parent / data / torrents / stefano / dest
# Chown-R btg: btg / data / torrents / Stefano
# Btgpasswd-config / etc / btg / daemon.ini-create-add-temp / data / torrents / stefano / temp-work / data / torrents / stefano / work-seed / data / torrents / stefano / seed-dest / data / torrent / stefano / dest-password-username stefano
# Usermod-a-G btg stefano

Obviously, replace the word "stefano" with that of your user and repeat the above procedure for any users who want to enable downloading torrents.

We just have to pick the 'good init file created by Pierre-Yves Landuré to make btg starts as a daemon every time the serverino Alix. Btg-daemon file you can download it from here . You have to download it in the / etc / init.d like this:

# Cd / etc / init.d
# Wget http://howto.landure.fr/gnu-linux/debian-4-0-etch/installer-btg-et-son-interface-web-wwwbtg-sur-debian-4-0-etch/btgdaemon

We conclude by configuring the daemon to start automatically when using update-rc.d:

# Update-rc.d defaults btgdaemon

We start the daemon:

# / Etc / init.d / start btgdaemon

And from now on we can start to use our web client. Open your broswer and aim to bookmark this address:

http:// <vostro_IP> / btg

After the first login you will be prompted to insert the first setup ... everything is easy, enter the data you asked and you're ready to download ;)

Did you like this article? Subscribe to newslettere to receive new articles added to the site:

Your email:

Related articles:

  1. [Help] realize a low-cost servers for mail and sharing files torrent (Part 5) I promised you that this part of the guide has affected ...
  2. [Help] realize a low-cost servers for mail and sharing files torrent (Part 3) In "Part 3" of this series of articles leading, I'll show ...
  3. [Help] realize a low-cost servers for mail and sharing files torrent (Part 8) We have reached the last part of the guide. Now face the "mass ...

Related articles processed by the plugin Yet Another Related Posts .

  1. francesco
    April 10, 2009 at 15:00 | # 1

    Hello,
    sercik are, I believe you remember since we felt e-mail.

    How about rtorrent?

  2. stefano
    April 10, 2009 at 23:43 | # 2

    @ Francis:
    Mmmm do not know ... I never used .. but uses libtorrent?

  3. francesco
    April 14, 2009 at 12:24 | # 3

    @ Stephen:
    It uses libtorrent

    Maybe I can lend a hand to install the libtorrent btg rastaerbar as your guide
    the fact is that I use clarkconnect based on centos
    and I'm filling all at hand :)

    I first downloaded and installed boost 1.35 (I saw that he wanted libtorrent> = 1.35)
    but now in the libtorrent configure tells me:

    ##########
    Whether checking the Boost:: Python library is available ... yes
    checking for main in-lboost_python ... no
    checking for main in-lboost_python ... (cached) no
    configure: error: Unable to find Boost.Python library, this is required to build python bindings.
    ###############

    Have you any idea?

  4. francesco
    April 14, 2009 at 18:01 | # 4

    Now I'm doing rpmbuild boost fedora-1:37 to 11 and seems to go well, is compiling for hours now (crazy). However when I compiled boost-1:35 there was very little, apparently compiled a few things, among others, the boost is complicated getting started I can not understand almost nothing ...
    we hope to resolve this boost from src.rpm, unless I first PC based :)

  5. stefano
    April 14, 2009 at 21:47 | # 5

    @ Francis:
    alone and you're doing is good :)
    I shudder when I hear rpm brrrrr : D

  6. francesco
    April 15, 2009 at 16:05 | # 6

    @ Stephen:
    Sorry if I keep posting, but I but a moral comfort :)
    in the end I was able to compile from tar.gz boost but I have successfully compiled boost with 3.7 to src.rpm rpmbuild-rebuild.

    Now I have successfully compiled libtorrent-rasterbar and I'm trying to compile btg-0.9.9 btg-pieces were left 0:35 that made the crazy configure BTG .. strange that the configure of libtorrent has not complained.

    I was cleaning the spare-btg btg 1:35 and now I break the boxes with the lack of a dialog, which fortunately seems to be sufficient yum install dialog
    Now let's see ...

    I doubt, I do not know if you can help:

    Whether checking the XML-RPC headers can not be used ...
    configure: Can not use XML-RPC headers from the specified location
    Whether checking the XML-RPC library can not be used ...
    configure: Can not link with XML-RPC from the specified location
    configure: Using internal XML-RPC implementation.

    I installed both python-xmlrpc which compiled and installed from source xmlrpc-c from here: http://xmlrpc-c.svn.sourceforge.net/viewvc/xmlrpc-c/advanced/

    hello and thank you for being there to review the fool who write

    Then maybe my experience we bring in and write a guide for the installation community clarkconnect 5 beta2 :)

  7. francesco
    April 15, 2009 at 16:09 | # 7

    francis wrote:

    @ Stephen:
    remained pieces of btg-0:35 that made the crazy configure BTG ..

    boost-error I mean 1:35

    I did clean and spare btg-1:35

    I wanted to write here also boost-1:35

  8. francesco
    April 16, 2009 at 11:18 | # 8

    I'm happy! I managed to compile everything and seems to work peronalizzazione adding the user name and path for folders

    Unfortunately the script does not work because I'm not on debian I think ...
    I do not know exactly what he was doing the script, but maybe download ipfilter.dat mailing list?

    I ask only one last help:
    You can run the script on a derivative centos?

    There are doors to open in the firewall? what?

    PS If you use clarkconnect or centos or any other derivative-based contos 5 btg can use successfully.

    All the dependencies are in the repositories and you just fill boost, ASIO, and the same libtorrent-rasterbar btg

    I tell you the files you need to download and compile

    autoconf-2.61-10.fc9.src.rpm
    automake-1.10.1-2.src.rpm
    m4-1.4.10-3.fc9.src.rpm

    these must be completed with rpmbuild-rebuild and then installed with rpm-Uvh filename

    This is necessary to create a build environment and upgraded

    Then you must compile libtorrent-rasterbar and to do this we must first fill out ASIO

    dates in succession the following commands

    cvs-d: pserver: anonymous@asio.cvs.sourceforge.net: / cvsroot / asio login

    cvs-z3-d: pserver: anonymous@asio.cvs.sourceforge.net: / cvsroot / asio asio co-P

    PS The first command will prompt for a password but it is enough to send.

    then go into the ASIO folder and pass the compilation:
    . / Configure-prefix = / usr
    make
    make install

    Now we move to libtorrent-rasterbar I completed without major problems these:
    libtorrent-0.14.2.tar.gz-rasterbar unzip into the directory
    I gave them:
    . / Configure-with-boost-python-prefix = / usr-with-ssl-with-asio = / usr / include / asio
    make
    make install

    now we must build and install btg-0.9.9 unzip, enter the folder
    just give:
    . / Configure-enable-www-enable-session-saving-enable-event-callback-enable-cli-enable-command-list-enable-btg-config-enable-gui-xmlrpc-with-prefix = / usr-enable -url
    make
    make install

    For all other info you can run a large guide of stefano

    Hello Stephen!

  9. stefano
    Apr. 16, 2009 at 14:27 | # 9

    @ Francis:
    Francesco .. which script are you referring to?

    The doors are open on the TCP fw 16,000 to reach the web interface of BTG and, of course, ports 10024 and 10025 (always TCP) for the proper functioning of libraries torrent ;)

    Cmq thank you so much for compiling information on rpm distro-like ... how about arranging some 'best in a text file and the instructions to publish a nice article on your behalf?
    please let me know,
    Stephen

  10. francesco
    April 16, 2009 at 16:31 | # 10

    I refer to the init scripts. You say in driving better init file created by Pierre-Yves Landuré
    here's what does not work on centos. in particular says it is vars.sh. I tried to give us a look, but are not abbstanza good.

    I do however limit BTG from rc.local

    regarding the gates I thought I understood, in fact it is written in the configuration file:

    listen-to = 0.0.0.0:16000
    torrent-range = 10024:10025

    0.0.0.0 What the hell that means?

    I just wrote everything I could to help someone eventualmene.

    however, are not familiar with HTML
    and you can easily fix pubbliachiamo also in your name.
    Moreover, what are you good :)

    However you can put my e-mail available to those who would help build on centos and clarkconnect

    Hello

    I noticed that there is an error in the post, I forgot to mention how to compile the boost I also rewrote a little better.
    you can rewrite delete it? because you can not edit the post.

    This program is wonderful is the only one who is disfiguring almost utorrent on windows unfortunately it would be a convenient option, namely to start the torrent automatically as it is possible with rtorrent.

    just put the torrent into a folder and automatically starts downloading.
    use it in combination with the Firefox extension "Automatic Save Folder" is something spectacular.
    Firefox save the torrent file in a specific place (always the same and by extending qutomatico) and rtorrent will automatically start downloading.

  11. stefano
    April 16, 2009 at 17:15 | # 11

    @ Francis:
    The init scripts need to start doing the "trick" when the PC / server ... is obviously dedicated to Debian, and therefore it is normal for not acting on your distro ;)

    I agree fully with you about the power of this system to use the system for p2p torrent ... not by chance that I decided to use this system instead of the initial use of the system TorrentFlux ;)

    One last thing ... if you do not mind, since you rearranged the comment, however, you can not change, I can send an email with the "new comment" at posta@INDIRIZZODELBLOG.eu ? (Obviously replace with INDIRIZZODELBLOG stefanolaguardia.eu ;) ) If I send the comment page from system I to be published ... then if you give me your name or your nick-name, enter it as your article under the CC license as that site and, thus, fatherhood is because your I feel rightly so ;)

    Hello,
    Stephen

    PS: Cmq you did a great job, congratulations!

  12. pamarcan
    April 17, 2009 at 9:37 | # 12

    thanks for the help, but I think I have a permission problem or maybe I've done something wrong:
    when adding the user foo with btgpasswd me the error

    btgpasswd: Unable to add user.

    foo is a regular user with its home in / home / foo without special permits and created a simple useradd. if I use-v with btgpasswd tell me more

    control flags '0 '
    callback '!'

  13. pamarcan
    April 17, 2009 to 11:41 | # 13

    @ Pamarcan:

    oops sorry, the first problem I solved compiling btg.
    opening hours of btgdaemon tells me:

    btgdaemon: Could not open / create session file '/ data / btg / daemon.saved'

    mmm ... permissions?

  14. stefano
    April 17, 2009 at 12:12 | # 14

    @ Pamarcan:
    One :) Permits 100%
    You have to give write permission on the dir / data / btg / user that starts the daemon btg ;)

  15. pamarcan
    April 17, 2009 at 16:51 | # 15

    @ Stephen:
    ok but the fact is that root to start the service, there should be permission problems

  16. stefano
    April 17, 2009 at 17:07 | # 16

    @ Pamarcan:
    Root ?!?!?! Mmmmm
    I could be wrong, but from memory I remember that the user * running * the service is called a "BTG" ... in time qsto Nos I have access to the server so cannot check, but I encourage you to verify the user running btgdaemon!

  17. pamarcan
    April 17, 2009 at 17:15 | # 17

    @ Stephen:

    you're right it does btg, I changed the owner of / data but nothing same error

    chown-R btg: btg / data

  18. pamarcan
    April 18, 2009 at 10:04 | # 18

    ok I managed to start btgdaemon but can not access the server, either locally or localhost. ports on the firewall are open even if nmap can not find anything.

  19. stefano
    April 18, 2009 at 10:37 | # 19

    @ Pamarcan:
    the server verifies that the services are active and open doors with a
    netstat-tap

    Nn If nmap is nothing to say that the doors are open :)

  20. pamarcan
    April 18, 2009 at 10:58 | # 20

    This is the output

    tcp 0 0 *: 16000 *: * LISTEN 3396/btgdaemon

  21. stefano
    April 18, 2009 at 11:15 | # 21

    @ Pamarcan:
    daemon is active ... but that interface uses to connect to the daemon? If you follow my guide, I recommend using the web interface ... but you have a web daemon running? (Apache, lighttpd, etc.)

  22. pamarcan
    April 18, 2009 at 12:43 | # 22

    ok solved

    I had set wrong lighttpd.conf

    Thanks for the help :)
    to make good

  23. Nux
    May 12, 2009 at 24:17 | # 23

    Hello,
    I slavishly followed your guide.

    I have a problem when I try to make to btg-0.9.9 gives me:

    g + +-DHAVE_CONFIG_H-I. -I .. -DNDEBUG-pthread-DTORRENT_USE_OPENSSL -I/usr/include/libtorrent-I .. -Pthread -I/usr/include-g-O2-DNDEBUG-DBTG_DEBUG DBTG_OPTION_SAVESESSIONS = = 0-0-0-DBTG_OPTION_UPNP DBTG_OPTION_EVENTCALLBACK = = = DBTG_OPTION_USELTUPNP 0-0-0-DBTG_REV DBTG_OPTION_USECYBERLINK = = = 0-TRUNK-DBTG_OPTION_URL DBTG_INTERNAL_XMLRPC = 1 -g-O2-MT libdaemon_la-daemonhandler_url.lo-MD-MP-MF .deps / libdaemon_la-daemonhandler_url.Tpo daemonhandler_url.cpp-c-fPIC-DPIC-o .libs / libdaemon_la-daemonhandler_url.o
    g + +: Internal error: Killed (program cc1plus)
    Please submit a full bug report.
    See for instructions.
    make [3]: *** [libdaemon_la-daemonhandler_url.lo] Error 1
    make [3]: Leaving directory `/ tmp/btg-0.9.9/daemon '
    make [2]: *** [all-recursive] Error 1
    make [2]: Leaving directory `/ tmp/btg-0.9.9/daemon '
    make [1]: *** [all-recursive] Error 1
    make [1]: Leaving directory `/ tmp/btg-0.9.9 '
    make: *** [all] Error 2

    What could it be?

  24. stefano
    May 12, 2009 at 22:02 | # 24

    @ Nux:
    It seems to be a problem with the compiler ...
    http://www.mail-archive.com/gcc-bugs @ gcc.gnu.org/msg226450.html

  25. Jack
    July 4, 2009 at 22:09 | # 25

    Hello Stephen, I have a little problem with the web interface of BTG : ( every time he imposed the Global Limit "via the web interface, the system resets them all as default, that 'everything is unlimited. I can not understand how this happens, the file daemon.saved where there are meetings with the various figures (including me seems to have also understood the limits for each session) is owned by the User "BTG" and therefore there have permission problems, I think.
    I do not know where to go look, I've never this problem? Google is not exactly on my side, I hope for a response, hello!

  26. stefano
    July 5, 2009 at 13:16 | # 26

    @ Jack:
    Hello. I happened in recent days that set the maximum speed, but a restart had lost everything. Unfortunately ere able to understand what had happened I had a hardware problem (I hope it's the fault of the FA) and I still have not recovered : (

  27. Grosselli Alexander
    October 31, 2009 at 1:14 p.m. | # 27

    Hello and congratulations for the excellent guide. I have a problem when I try logging me btg always gives me error: "Failed to connect 127.0.0.1:16000: Connection refused". Do you have any idea how to fix this?

  28. stefano
    November 1, 2009 at 18:06 | # 28

    @ Grosselli Alexander
    Hello,

    open a terminal and try to verify that the port 16000 is listening segunente with the command:

    netstat-tap

  29. Alexander Grosselli
    November 2, 2009 at 14:32 | # 29

    He @ stefano:
    you're right is not listening.
    Search on Google how to set or, alternatively, if you have time, could you give me a tip? hello thanks

  1. March 14, 2009 at 18:03 | # 1
  2. March 14, 2009 at 19:29 | # 2
  3. April 7, 2009 at 16:30 | # 3
  4. April 20, 2009 at 15:09 | # 4