Announcement

Collapse
No announcement yet.

The Seedbox From Scratch Script (Multi-user, quota, sabnzbd and Deluge)

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • The Seedbox From Scratch Script (Multi-user, quota, sabnzbd and Deluge)

    Introduction
    This unnatended script, intends to automatically install a fresh multi-user seedbox and it was initially 100% based on this Copper's setup tutorial: http://www.torrent-invites.com/seedb...nc-ubuntu.html. The final result of your seedbox will be exactly the same and the changes I made in the original script were only to provide automation to the process, but one package was upgraded: Autodl-irssi is installed in version 1.31 and not 1.10.

    Changes were made to make it support a multi-user environment. So now this script is not 100% compatible with Copper's tutorial anymore but it is mostly based on it.

    Current Version: 2.1.9
    Last stable version: 2.1.8

    What it will install in your box
    Installed software

    - ruTorrent 3.4 + official plugins
    - rTorrent 0.9.2 or 0.9.3
    - libTorrrent 0.13.2 or 0.13.3
    - Deluge 1.3.5 (current stable) multi-user
    - mktorrent

    - JailKit (providing chroot jail)
    - Fail2ban
    - Apache (SSL)

    - OpenVPN
    - PHP 5 and PHP-FPM (FastCGI to increase performance)
    - Linux Quota
    - SSH Server (for SSH terminal and sFTP connections)

    - vsftpd (Very Secure FTP Deamon - for users jailed and non-jailed)
    - IRSSI
    - Webmin (use it to manage your users quota)
    -
    sabnzbd: Ubuntu PPA Repository - SABnzbd
    - Rapidleech

    Main ruTorrent plugins

    autotoolscpuload, diskspace, erasedata, extratio, extsearch, feeds, filedrop, filemanager, geoip, history, logoff, mediainfo, mediastream, rss, scheduler, screenshots, theme, trafic and unpack

    Additional ruTorrent plugins

    - Autodl-IRSSI (with an updated list of trackers)
    - A modified version of Diskpace to support quota (by me)
    - Filemanager (modified to handle rar, zip, unzip, tar and bzip)
    - Fileupload
    - Fileshare
    - MediaStream (to watch your videos right from your seedbox)
    - Logoff

    - Theme: Oblivion


    Supported Operating Systems
    Ubuntu Server 12.04 - 64bit (tested on a VirtualBox VM)
    Ubuntu Server 12.10 - 64bit (tested on a VirtualBox VM)
    Ubuntu Server 12.04 - 64bit (OVH's Kimsufi - Precise)
    Debian 6.0 - 32 and 64bit (OVH's Kimsufi - Squeeze)


    Step 0 - Warnings
    If you have any problems, please first

    READ THE FAQ: FAQ


    If you don't know Linux ENOUGH:

    DO NOT install this script on a non OVH Host.
    It is doable, but you'll have to know Linux to solve some problems.

    DO NOT use capital letters, all your usernames should be written in lowercase.

    DO NOT upgrade anything in your box, ask in the thread before even thinking about it.

    DO NOT try to reconfigure packages using other tutorials.



    Step 1
    Install your operating system on a computer or a virtual machine
    (all my tests were made on a virtualized [VirtualBox] operating system)

    Step 2
    Login to your server using an SSH client (PuTTY) using your root account, this also will be your seedbox username.

    Step 3
    Download the script and run it. Just copy and paste those commands on your terminal:


    Code:
    wget -N https://raw.github.com/Notos/seedbox-from-scratch/v2.1.9/seedbox-from-scratch.sh
    time bash ~/seedbox-from-scratch.sh

    Step 4
    Just answer all script questions.

    Step 5
    Cross your fingers and wait for the installation to finish, this may take a while and an automatic reboot of your server will occur at the end.

    Step 6
    After reboot, use a browser (Firefox, Chrome...):

    To acess your seedbox
    http://ip-addres-of-your-server/rutorrent

    To view info about all your users
    http://ip-addres-of-your-server/seedboxInfo.php

    Step 7
    ENJOY IT!




    To access services installed on your server
    ruTtorrent
    URL: https://<Server IP or Server Name>/rutorrent
    U: <username>
    P: <rutorrentpassword>

    FTP - SSH
    IP: <Server IP or Server Name>
    U: <username>
    P: <password>
    Port: 21976 (or the one you typed during setup)
    Protocol: SFTP - SSH File Transfer Protocol (not "FTP")

    FTP - vsftpd
    IP: <Server IP or Server Name>
    U: <username>
    P: <password>
    Port: 21201
    Protocol: FTP

    SSH
    IP: <Server IP or Server Name>
    U: <username>
    P: <password>
    Port: 21976 (or the one you typed during setup)
    Note that root login is disabled. Login as the user you created in the first steps and prefix a command with "sudo" if you need root privileges.

    Webmin
    IP: https://<Server IP or Server Name>:10000
    U: <username>
    P: <password>
    Port: 10000

    If you are a Kimsufi user, your <Server Name> should be something like ksXXXXXX.kimsufi.com.


    Multi-user Commands
    You must be logged in as an user that has permission to run sudo.
    But don't use sudo to run these commands, it will be used internally:

    createSeedboxUser

    deleteSeedboxUser

    changeUserPasswordI think that the command names are self explanatory.



    Downgrading to rTorrent 0.8.9 and libtorrent 0.12.9
    You must be logged in as an user that has permission to run sudo.
    But don't use sudo to run these commands, it will be used internally:

    downgradeRTorrent

    upgradeRTorrent

    I think that the command names are self explanatory. But ugrade script will get you back to 0.9.2.



    Quota
    Quota is disabled by default in your box. To enable and use it, you'll have to open Webmin, using the address you can find in one of the tables box above this. After you sucessfully logged on Webmin, enable it by clicking

    System => Disk and Network Filesystems => /home => Use Quotas? => Select "Only User"
    => Save

    Now you'll have to configure quota for each user, doing

    System => Disk Quotas => /home => <username> => Configure the "Soft kilobyte limit" => Update

    Note that /home is the mount point (disk partition) your /home is located.

    As soon as you save it, your seedbox will also update the available space to all your users.



    Notes
    If you have an Ubuntu Server 12.04, but you didn't installed it yourself, make sure the username you are using has SUDO rights in this server, issue the following command at the SSH prompt:
    sudo clear

    It may ask for your password and, after that, if the screen is cleared and the user you are using is not root, you are good to go. Otherwise you should follow steps 1 to 5 of Copper's tutorial: http://www.torrent-invites.com/seedb...nc-ubuntu.html.

    After install the SSH port of your server will be changed to 21976 (or whatever port number you specify), remember that, but, for security reasons you should change it, also refer to Copper's tutorial, step 4 will help you do that, you just have to change the port number, nothing else.

    If you want to use ZNC, just log in to your server, using SSH, and execute this:
    znc --makeconf

    And follow the step 31 of Copper's tutorial.
    Last edited by Lefteris; March 8, 2013, 09:00 PM.
    The Seedbox From Scratch Script

    I'm not a native english speaker and my writing and (even) understanding of the language is far, far away from fluent, so, if you, native english speaker or not, have enough linguistic proficiency and found something in my words which you are absolutely certain that is a grammar or spell error, please, feel free correct me by PM or even expose it (so people learn from my errors), just don't go (too) off topic and don't make me more unsure than I already am.



  • #2

    That wasn't a small amount of work, so thank you for writing that. And in particular for the work that went into testing your script.
    I have no doubt that this will turn out to be very popular enhancement. Cheers























    Fortune and love favour the brave .-. Ovid ....

    Comment


    • #3
      just installed on a clean 12.04 install and when i tryed to load rutorrent
      i get this error
      Internal Server Error

      The server encountered an internal error or misconfiguration and was unable to complete your request.
      Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
      More information about this error may be available in the server error log.

      Comment


      • #4
        that's a good example of how you make the perfect topic with the perfect content either :)
        Thank you so much for this topic mate .
        +rep

        Comment


        • #5
          Never saw this error before in my tests, but it's exactly how it works in computing.

          Can you paste here a portion of your apache logs (/var/log/apache2)?

          Try doing a

          sudo tail -f /var/log/apache2/*

          Refresh your page and copy what was shown after refreshing.

          Don't forget to remove public IP addresses from it.
          The Seedbox From Scratch Script

          I'm not a native english speaker and my writing and (even) understanding of the language is far, far away from fluent, so, if you, native english speaker or not, have enough linguistic proficiency and found something in my words which you are absolutely certain that is a grammar or spell error, please, feel free correct me by PM or even expose it (so people learn from my errors), just don't go (too) off topic and don't make me more unsure than I already am.


          Comment


          • #6
            Originally posted by Lefteris View Post
            Never saw this error before in my tests, but it's exactly how it works in computing.

            Can you paste here a portion of your apache logs (/var/log/apache2)?

            Try doing a

            sudo tail -f /var/log/apache2/*

            Refresh your page and copy what was shown after refreshing.

            Don't forget to remove public IP addresses from it.


            ==> /var/log/apache2/access.log <==
            (myip) - caine [22/Aug/2012:03:35:33 +0200] "GET /rutorrent HTTP/1.1" 500 565 "-" "Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1"

            Comment


            • #7
              Originally posted by tazertorrent View Post
              ==> /var/log/apache2/access.log <==
              (myip) - caine [22/Aug/2012:03:35:33 +0200] "GET /rutorrent HTTP/1.1" 500 565 "-" "Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1"
              Look like it's not finding the rutorrent folder itself, so there is no rutorrent.

              I'm installing a fresh Ubuntu 12.04 here now, to see if there's any problems with this script. Sorry for that.
              The Seedbox From Scratch Script

              I'm not a native english speaker and my writing and (even) understanding of the language is far, far away from fluent, so, if you, native english speaker or not, have enough linguistic proficiency and found something in my words which you are absolutely certain that is a grammar or spell error, please, feel free correct me by PM or even expose it (so people learn from my errors), just don't go (too) off topic and don't make me more unsure than I already am.


              Comment


              • #8
                Originally posted by tazertorrent View Post
                just installed on a clean 12.04 install and when i tryed to load rutorrent
                i get this error
                Internal Server Error

                The server encountered an internal error or misconfiguration and was unable to complete your request.
                Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
                More information about this error may be available in the server error log.
                Same too. Can not get Apache to work... and conflict with ports...

                Comment


                • #9
                  Originally posted by mixman View Post
                  Same too. Can not get Apache to work... and conflict with ports...
                  Trying to understand that, sorry. Hoping to get an error I never got here.
                  The Seedbox From Scratch Script

                  I'm not a native english speaker and my writing and (even) understanding of the language is far, far away from fluent, so, if you, native english speaker or not, have enough linguistic proficiency and found something in my words which you are absolutely certain that is a grammar or spell error, please, feel free correct me by PM or even expose it (so people learn from my errors), just don't go (too) off topic and don't make me more unsure than I already am.


                  Comment


                  • #10
                    Was just trying reinstalling one of my dedi's thought i'd give your script a whirl.
                    Just wanna say thankyou great work lefteris and i hope you manage to get tthe kinks worked out.
                    PS. I don't know if it helps but my server with the issues was a fresh install of 12.04x64 Ubuntu on a 2G ks box

                    Good luck

                    Comment


                    • #11
                      Originally posted by tazertorrent View Post
                      Was just trying reinstalling one of my dedi's thought i'd give your script a whirl.
                      Just wanna say thankyou great work lefteris and i hope you manage to get tthe kinks worked out.
                      PS. I don't know if it helps but my server with the issues was a fresh install of 12.04x64 Ubuntu on a 2G ks box

                      Good luck
                      I ordered a 2G earlier this afternoon to test this script on it, because I suppose their operating systems are a little bit different from the retail. Waiting anxiously OVH bringing it up. Thanks again, mate.

                      ---------- Post added at 11:35 PM ---------- Previous post was at 11:17 PM ----------

                      Just got the same error, guys, trying to fix it.
                      The Seedbox From Scratch Script

                      I'm not a native english speaker and my writing and (even) understanding of the language is far, far away from fluent, so, if you, native english speaker or not, have enough linguistic proficiency and found something in my words which you are absolutely certain that is a grammar or spell error, please, feel free correct me by PM or even expose it (so people learn from my errors), just don't go (too) off topic and don't make me more unsure than I already am.


                      Comment


                      • #12
                        Oh fine, and... please can u figure script for adding more users?
                        Last edited by mixman; August 21, 2012, 11:09 PM.

                        Comment


                        • #13
                          Install problem solved. It was an apache password problem, caused by an inexistant package.

                          Originally posted by mixman View Post
                          Oh fine, and... please can u figure script for adding more users?
                          Yeah, I was thinking about creating also an script to add new users. But this one was not made by me, as the first post says, it's a Copper tutorial that I only transformed in a script. I'll take closer look at it and try to create something, ok?
                          The Seedbox From Scratch Script

                          I'm not a native english speaker and my writing and (even) understanding of the language is far, far away from fluent, so, if you, native english speaker or not, have enough linguistic proficiency and found something in my words which you are absolutely certain that is a grammar or spell error, please, feel free correct me by PM or even expose it (so people learn from my errors), just don't go (too) off topic and don't make me more unsure than I already am.


                          Comment


                          • #14
                            Originally posted by Lefteris View Post
                            Install problem solved. It was an apache password problem, caused by an inexistant package.
                            Hey reinstalled to test your script when log into rutorrent it just keeps asking me for username and password.
                            Not sure what the problem is. Does the script use a different username for rutorrent?

                            edit::

                            so i figured i'd just change the password file so

                            sudo htdigest -c /etc/apache2/htpasswd rutorrent >user<

                            fixed working for me now... Not sure why it didn't work originally

                            **Just reinstalled to test if it happened again. Yes happened again. Can't login to rutorrent
                            Last edited by tazertorrent; August 22, 2012, 07:19 AM.

                            Comment


                            • #15
                              Originally posted by Lefteris View Post
                              I was thinking about creating also an script to add new users. But this one was not made by me, as the first post says, it's a Copper tutorial that I only transformed in a script. I'll take closer look at it and try to create something, ok?

                              You could do something along these lines to setup multiple users. Each user will need an unique login, rtorrent instance, home directory, port range, scgi_port and config.php. The setup should be done from the new user login to preserve permissions and each user should be chrooted to their respective home directories.

                              Create a second user. Choose an SSH password when prompted
                              sudo adduser <username2>

                              Add the new user to the passwords file. Choose a <WEBusername2> password for rutorrent when prompted
                              sudo htdigest /etc/apache2/htpasswd rutorrent <username2>

                              Every user will need to run their own instance of rtorrent
                              sudo cp ~/.rtorrent.rc /home/<username2>
                              sudo chown <username2>:<username2> /home/<username2>/downloads
                              sudo nano /home/<username2>/.rtorrent.rc

                              Find the following lines in /home/<username2>/.rtorrent.rc
                              port_range = 55950-56000
                              scgi_port = 127.0.0.1:5000
                              directory = /home/<username>/downloads
                              session = /home/<username>/downloads/.session
                              schedule = watch_directory,5,5,load_start=/home/<username>/downloads/watch/*.torrent
                              # on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/home/<username>/downloads/complete/ ;d.set_directory=/home/<username>/downloads/complete/"

                              And change them to:
                              port_range = 56001-56050
                              scgi_port = 127.0.0.1:5001
                              directory = /home/<username2>/downloads
                              session = /home/<username2>/downloads/.session
                              schedule = watch_directory,5,5,load_start=/home/<username2>/downloads/watch/*.torrent
                              # on_finished = move_complete,"execute=mv,-u,$d.get_base_path=,/home/<username2>/downloads/complete/ ;d.set_directory=/home/<username2>/downloads/complete/"

                              Ensure that relevant username2 rtorrent directories exist
                              sudo mkdir /home/<username2>
                              sudo mkdir /home/<username2>/downloads/watch
                              sudo mkdir /home/<username2>/downloads/.session
                              sudo chown -R <username2>:<username2> <username2>/downloads

                              Configure rutorrent by creating a conf directory for each user
                              cd /var/www/rutorrent/conf/
                              mkdir users/<WEBusername>
                              mkdir users/<Webusername2>

                              Copy the config.php file from the current default directory to each users conf directory
                              sudo cp config.php users/<WEBusername2>

                              Edit each user config.php file. Note that the original user file doesn't need to change
                              sudo nano users/<WEBusername2>/config.php

                              Find the following lines in users/<WEBusername2>/config.php
                              $scgi_port = 5000;
                              $scgi_host = "127.0.0.1";

                              And change them to:
                              $scgi_port = 5001;
                              $scgi_host = "127.0.0.1";

                              Then give the ownership to the webserver
                              cd /var/www
                              sudo chown -R www-data:www-data rutorrent
                              sudo chmod -R 755 rutorrent

                              Now when you browse to the following URL, you will be prompted with the login dialog. Your rutorrent instance will connect to the relevant rtorrent session based on which username is entered for the login.
                              Code:
                              https://<serverIP>/rutorrent/



                              Last edited by Copper; August 22, 2012, 10:16 AM.
                              Fortune and love favour the brave .-. Ovid ....

                              Comment

                              Working...
                              X