[SOLVED] rtorrent+rutorrent

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [SOLVED] rtorrent+rutorrent

      Hey guys, I don't know if this is the right section but I was trying to install rtorrent + rutorrent the other day and I couldn't access the rutorrent webui (it was giving me a 404). So after a little searching, I tried to symlink the web dir to the rutorrent dir, but then it gave a permission error. Same error when I tried just copying the rutorrent folder to the web folder. In both cases the permissions where 755 and the owner was the openmediavault user. I also tried messing around with the website plugin, but I couldn't get it working as I wasn't able to set a directory other than the shared lvm.

      I am running OMV 0.5

      The post was edited 1 time, last by svart ().

    • Re: rtorrent+rutorrent

      I know it's possible to hook rutorrent into OMV on o.4 but, I haven't tried it on 0.5 yet. The way I did it before was to change the listening ports for omv and then create the configuration for a virtual host aliasing. It enabled me to access my normal website at mysite.com rutorrent at mysite.com/rutorrent/ and omv at mysite.com:81. I takes somedoing but, it is definately possible.
    • Re: rtorrent+rutorrent

      Thanks for the reply man, it helped! I actually did it by replacing the symlink in sites-enabled (in /etc/apache2) with one pointing to the following file:

      Source Code

      1. Listen 81
      2. <VirtualHost *:80>
      3. DocumentRoot /var/www
      4. <Directory />
      5. Options FollowSymLinks
      6. AllowOverride None
      7. </Directory>
      8. <Directory /var/www/>
      9. Options Indexes FollowSymLinks MultiViews
      10. AllowOverride None
      11. Order allow,deny
      12. allow from all
      13. </Directory>
      14. ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
      15. <Directory "/usr/lib/cgi-bin">
      16. AllowOverride None
      17. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      18. Order allow,deny
      19. Allow from all
      20. </Directory>
      21. ErrorLog ${APACHE_LOG_DIR}/error.log
      22. # Possible values include: debug, info, notice, warn, error, crit,
      23. # alert, emerg.
      24. LogLevel warn
      25. CustomLog ${APACHE_LOG_DIR}/access.log combined
      26. </VirtualHost>
      27. <VirtualHost *:81>
      28. Include /etc/apache2/openmediavault-webgui.d/*.conf
      29. SSLEngine off
      30. </Virtualhost>
      Display All
    • Re: [SOLVED] rtorrent+rutorrent

      Hi svart,

      I am trying to achieve the same. Does this file mean that your apache listens on port 81 and this is the port for your OVM GUI? You then have a virtualhost at port 80 for rutorrent? Do you then enter serverIP/rutorrent to get to rutorrent or I assume you just enter serverIP and it brings up rutorrent?

      I want to have my OVM on port 8080, where it is set now and I want to get to rutorrent through serverIP/rutorrent. . .

      Many thanks,
      C
    • Re: [SOLVED] rtorrent+rutorrent

      Hey, apache functions as it would by default on port 80, so I access rutorrent from serverIP/rutorrent and the OMV panel from serverIP:81. If you want to run the OMV panel in port 8080 you can simply change the listening port in my file to 8080. So in the end you would have a file like this:

      Source Code

      1. Listen 8080
      2. <VirtualHost *:80>
      3. DocumentRoot /var/www
      4. <Directory />
      5. Options FollowSymLinks
      6. AllowOverride None
      7. </Directory>
      8. <Directory /var/www/>
      9. Options Indexes FollowSymLinks MultiViews
      10. AllowOverride None
      11. Order allow,deny
      12. allow from all
      13. </Directory>
      14. ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
      15. <Directory "/usr/lib/cgi-bin">
      16. AllowOverride None
      17. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      18. Order allow,deny
      19. Allow from all
      20. </Directory>
      21. ErrorLog ${APACHE_LOG_DIR}/error.log
      22. # Possible values include: debug, info, notice, warn, error, crit,
      23. # alert, emerg.
      24. LogLevel warn
      25. CustomLog ${APACHE_LOG_DIR}/access.log combined
      26. </VirtualHost>
      27. <VirtualHost *:8080>
      28. Include /etc/apache2/openmediavault-webgui.d/*.conf
      29. SSLEngine off
      30. </Virtualhost>
      Display All
    • Re: [SOLVED] rtorrent+rutorrent

      Thank-you for your response, it assisted me in getting it to work.

      In my base installed I had only one site enabled, /etc/apache2/sites-enabled/openmediavault-webgui, which is a sym-link of the same file in ..../sites-available. I therefore edited /etc/apache2/sites-available/openmediavault-webgui to look as per your suggestion.

      I note that I had to make a few other changes to get things working and I list them in case it helps someone else in the future.

      The file /etc/apache2/ports.conf was set up to listen on port 8080, but we had just specified that in the revised /etc/apache2/sites-available/openmediavault-webgui.

      Further I could not access myserverip/rutorrent as there was the webserver was not being told to listen anywhere on port 80. I therefore had to change /etc/apache2/ports.conf to;

      Source Code

      1. NameVirtualHost *:80
      2. Listen 80


      Now everything works.

      As an extension, I added password protection to my rutorrent page by changing the file /etc/apache2/sites-available/openmediavault-webgui to;

      Brainfuck Source Code

      1. Listen 8080
      2. <VirtualHost *:80>
      3. DocumentRoot /var/www
      4. <Directory />
      5. Options FollowSymLinks
      6. AllowOverride None
      7. </Directory>
      8. <Directory /var/www/>
      9. Options Indexes FollowSymLinks MultiViews
      10. AllowOverride None
      11. Order allow,deny
      12. allow from all
      13. </Directory>
      14. ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
      15. <Directory "/usr/lib/cgi-bin">
      16. AllowOverride None
      17. Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
      18. Order allow,deny
      19. Allow from all
      20. </Directory>
      21. # Location .htpasswd for rutorrent
      22. #-----------------------------------------------------------------------------------
      23. <Directory "/var/www/rutorrent/">
      24. AuthUserFile /var/www/rutorrent/.htpasswd
      25. AuthName "ruTorrent_login"
      26. AuthType Basic
      27. Require Valid-User
      28. </Directory>
      29. #-----------------------------------------------------------------------------------
      30. ErrorLog ${APACHE_LOG_DIR}/error.log
      31. # Possible values include: debug, info, notice, warn, error, crit,
      32. # alert, emerg.
      33. LogLevel warn
      34. CustomLog ${APACHE_LOG_DIR}/access.log combined
      35. </VirtualHost>
      36. <VirtualHost *:8080>
      37. Include /etc/apache2/openmediavault-webgui.d/*.conf
      38. SSLEngine off
      39. </Virtualhost>
      Display All


      I then;

      Source Code

      1. cd /var/www/rutorrent
      2. sudo htpasswd -c /var/www/rutorrent/.htpasswd “scoobynz”


      you will be asked for a password twice.
    • Im just updating this thread for OMV 1.0+, in-case it helps someone and in-case I need the this info in the future.

      Install the rolls-royce of torrent software using this thread / tutorial;
      http://lowendtalk.com/discussion/29249/install-rtorrent-nginx-rutorrent-perfect-leb-seedbox-solution

      I prefer to install rutorrent from SVN rather than downloading zip files, this makes updating easier in the future;
      code.google.com/p/rutorrent/wiki/GetFromSVN

      Below is a file to start at boot;
      ​nano /etc/init.d/rtorrent
      sudo chmod +x /etc/init.d/rtorrent
      sudo update-rc.d rtorrent defaults
      sudo /etc/init.d/rtorrent start


      ​#!/bin/sh
      ### BEGIN INIT INFO
      # Provides: rtorrent
      # Required-Start: $remote_fs $syslog
      # Required-Stop: $remote_fs $syslog
      # Default-Start: 2 3 4 5
      # Default-Stop: 0 1 6
      # Short-Description: Start daemon at boot time
      # Description: Enable service provided by daemon.
      ### END INIT INFO
      #############
      ###<Notes>###
      #############
      # This script depends on screen.
      # For the stop function to work, you must set an
      # explicit session directory using ABSOLUTE paths (no, ~ is not absolute) in your rtorrent.rc.
      # If you typically just start rtorrent with just "rtorrent" on the
      # command line, all you need to change is the "user" option.
      # Attach to the screen session as your user with
      # "screen -dr rtorrent". Change "rtorrent" with srnname option.
      # Licensed under the GPLv2 by lostnihilist: lostnihilist _at_ gmail _dot_ com
      ##############
      ###</Notes>###
      ##############

      #######################
      ##Start Configuration##
      #######################
      # You can specify your configuration in a different file
      # (so that it is saved with upgrades, saved in your home directory,
      # or whateve reason you want to)
      # by commenting out/deleting the configuration lines and placing them
      # in a text file (say /home/user/.rtorrent.init.conf) exactly as you would
      # have written them here (you can leave the comments if you desire
      # and then uncommenting the following line correcting the path/filename
      # for the one you used. note the space after the ".".
      # . /etc/rtorrent.init.conf

      #Do not put a space on either side of the equal signs e.g.
      # user = user
      # will not work
      # system user to run as
      user="rtorrent"

      # the system group to run as, not implemented, see d_start for beginning implementation
      # group=`id -ng "$user"`

      # the full path to the filename where you store your rtorrent configuration
      config="`su -c 'echo $HOME' $user`/.rtorrent.rc"
      echo $config
      # set of options to run with
      options=""

      # default directory for screen, needs to be an absolute path
      base="`su -c 'echo $HOME' $user`"

      # name of screen session
      srnname="rtorrent"

      # file to log to (makes for easier debugging if something goes wrong)
      logfile="/var/log/rtorrentInit.log"
      #######################
      ###END CONFIGURATION###
      #######################
      PATH=/usr/bin:/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin
      DESC="rtorrent"
      NAME=rtorrent
      DAEMON=$NAME
      SCRIPTNAME=/etc/init.d/$NAME

      checkcnfg() {
      exists=0
      for i in `echo "$PATH" | tr ':' '\n'` ; do
      if [ -f $i/$NAME ] ; then
      exists=1
      break
      fi
      done
      if [ $exists -eq 0 ] ; then
      echo "cannot find rtorrent binary in PATH $PATH" | tee -a "$logfile" >&2
      exit 3
      fi
      if ! [ -r "${config}" ] ; then
      echo "cannot find readable config ${config}. check that it is there and permissions are appropriate" | tee -a "$logfile" >&2
      exit 3
      fi
      session=`getsession "$config"`
      if ! [ -d "${session}" ] ; then
      echo "cannot find readable session directory ${session} from config ${config}. check permissions" | tee -a "$logfile" >&2
      exit 3
      fi
      }

      d_start() {
      [ -d "${base}" ] && cd "${base}"
      stty stop undef && stty start undef
      su -c "screen -ls | grep -sq "\.${srnname}[[:space:]]" " ${user} || su -c "screen -dm -S ${srnname} 2>&1 1>/dev/null" ${user} | tee -a "$logfile" >&2
      # this works for the screen command, but starting rtorrent below adopts screen session gid
      # even if it is not the screen session we started (e.g. running under an undesirable gid
      #su -c "screen -ls | grep -sq "\.${srnname}[[:space:]]" " ${user} || su -c "sg \"$group\" -c \"screen -fn -dm -S ${srnname} 2>&1 1>/dev/null\"" ${user} | tee -a "$logfile" >&2
      su -c "screen -S "${srnname}" -X screen rtorrent ${options} 2>&1 1>/dev/null" ${user} | tee -a "$logfile" >&2
      }

      d_stop() {
      session=`getsession "$config"`
      if ! [ -s ${session}/rtorrent.lock ] ; then
      return
      fi
      pid=`cat ${session}/rtorrent.lock | awk -F: '{print($2)}' | sed "s/[^0-9]//g"`
      if ps -A | grep -sq ${pid}.*rtorrent ; then # make sure the pid doesn't belong to another process
      kill -s INT ${pid}
      fi
      }

      getsession() {
      session=`cat "$1" | grep "^[[:space:]]*session[[:space:]]*=" | sed "s/^[[:space:]]*session[[:space:]]*=[[:space:]]*//" `
      echo $session
      }

      checkcnfg

      case "$1" in
      start)
      echo -n "Starting $DESC: $NAME"
      d_start
      echo "."
      ;;
      stop)
      echo -n "Stopping $DESC: $NAME"
      d_stop
      echo "."
      ;;
      restart|force-reload)
      echo -n "Restarting $DESC: $NAME"
      d_stop
      sleep 1
      d_start
      echo "."
      ;;
      *)
      echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
      exit 1
      ;;
      esac

      exit 0