Plugins will not start (probably apache/permission issue)

das329717

Member
May 25, 2018
928
0
16
I have installed rtorrent and rutorrent, most things seams to work fine. One thing that does not work is the plugins to rutorrent. It is most likely an issue with apache and catalog permissions

I gett error like these:

Quote
rTorrent's user can't access settings directory for read/write/execute. ruTorrent will not work.
rTorrent's user can't access file ./test.sh for read/execute. ruTorrent will not work.
rTorrent's user can't access torrents directory for read/execute. You can't add torrents through ruTorrent.
Web server can't access settings directory for read/write/execute. ruTorrent can't save own settings.
Web server can't access torrents directory for read/write/execute. You can't add torrents through ruTorrent.

This group of errors most likely relate to incorrect ruTorrent installation. Say the achive has been unpacked not under a web-server user account.

from:http://code.google.com/p/rutorrent/wiki/ErrorMessages


Unfortunately they don´t explain howto solve this.

If you want to try for you self here is my .sh script I made

Code:
#Install necessary packages for basic rtorrent
sudo apt-get update

sudo apt-get install -y subversion libncurses5-dev libsigc++-2.0-dev libcurl4-openssl-dev build-essential screen nano wget

#pacages for webbserver, php och XML-RPC
sudo apt-get install -y apache2 libapache2-mod-scgi php5 php5-xmlrpc php5-sqlite libxmlrpc-c3-dev libxmlrpc-c3

# install libtorrent
cd /home/torrent/

wget http://libtorrent.rakshasa.no/downloads/libtorrent-0.12.6.tar.gz

sudo tar xvf libtorrent-0.12.6.tar.gz

cd libtorrent-0.12.6

sudo ./configure

sudo make

sudo make install

#rtorrent
cd /home/torrent/

wget http://libtorrent.rakshasa.no/downloads/rtorrent-0.8.6.tar.gz

sudo tar xvf rtorrent-0.8.6.tar.gz

cd rtorrent-0.8.6

sudo ./configure --with-xmlrpc-c

sudo make

sudo make install

sudo ldconfig

## set up catalogs
sudo mkdir -p /home/torrent/torrents/watch/ /home/torrent/torrent/downloading/ /home/torrent/torrent/complete/ /home/torrent/torrent/.session/ /home/torrent/torrent/torrentfiles/

# setup Rutorrent

cd /var/www/

svn co http://rutorrent.googlecode.com/svn/trunk/rutorrent

svn up

# plugins
# To test
chmod -R 777 /var/www/

#plugins dl
cd /var/www/rutorrent/plugins
svn co http://rutorrent.googlecode.com/svn/trunk/plugins/rpc
svn co http://rutorrent.googlecode.com/svn/trunk/plugins/rss/
svn co http://rutorrent.googlecode.com/svn/trunk/plugins/create/
svn co http://rutorrent.googlecode.com/svn/trunk/plugins/search/
svn co http://rutorrent.googlecode.com/svn/trunk/plugins/autotools/

sudo /etc/init.d/apache2 restart

# just to make sure
sudo chown -R torrent.torrent /home/torrent


and an .rtorrent.rc file

Code:
# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
#max_peers = 120
#
# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
#max_peers_seed = 50
#
# Maximum number of simultanious uploads per torrent.
#max_uploads = 20
#
# Global upload and download rate in KiB. ”0? for unlimited.
#download_rate = 0
#upload_rate = 0
#
# Default directory to save the downloaded torrents.
directory = /home/torrent/torrent/downloading/;
#
# Default session directory.
session = /home/torrent/torrent/.session/;
#
# Watch a directory for new torrents, and stop those that have been deleted.
#chedule = watch_directory,5,5,load_start=/home/torrent/torrents/watch/*.torrent schedule = untied_directory,5,5,stop_untied=
schedule = watch_directory_1,10,10,"load_start=/home/torrent/torrents/watch/*.torren,d.set_custom1=/home/torrent/torrent/complete";
#
# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M;
#
#Stop torrents when reaching upload ratio in percent, when also reaching total upload in bytes, or when reaching final upload ratio in percent.
# example: stop at ratio 2.0 with at least 200 MB uploaded, or else ratio 20.0
#schedule = ratio,60,60,stop_on_ratio=200,200M,2000
#
# Port range to use for listening.
port_range = 6890-6999;
#
# Start opening ports at a random position within the port range.
#port_random = yes
#
# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes;
#
# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,enable_retry,prefer_plaintext;
#
scgi_port = 127.0.0.1:5000;
System used: Ubuntu 10.04 server minimal virtualization install (dont remember exactly the name)
 

dsouvik215

Member
May 25, 2018
896
0
16
the error tells you the problem.

try changing the rutorrent/share dir to be owned by the webuser.

if you have rutorrent installed to /usr/local/www/rutorrent, and your webuser is www it would be something like:

Code:
chown -R www:www /usr/local/www/rutorrent/share/
 

das329717

Member
May 25, 2018
928
0
16
hmm apperently I had already fixed this smiley.gif maby the latest reboot fixed it. But thanks anyway
Now the problem is that it cant find curl program or php interpiter, but i might be able to find a solution for this by myself. Will look at this during that day.
Sins I have not installed these the error message is verry logical smiley.gif

When everything is up and running I will link to a .OVF that people can import into there ESX machines (I assume every one has an ESX running at home)
 

jith45

Member
May 25, 2018
960
0
16
you may not have curl or php installed.


type:
Code:
which curl
which php

also the output of
Code:
php -v

would be useful to know.

if all else fails, you can try:
Code:
find / -name "php" -type f
Code:
find / -name "curl" -type f
(the find commands will find any file named php or curl)


after this, make sure these are set in the rutorrent/conf/config.php (or rutorrent/conf/users/USERNAME/config.php)
 

somus1735

Member
May 25, 2018
833
0
16
Thanks:

Code:
sudo apt-get install curl php5-cli
This solved (almost) every error message...


... except a plugin that wanted a newer version of xml-rpc, will compile from cvs instead of using the one from the repo. this will surely brake stuff smiley.gif

I will post a fully working install.sh file when I am done so no one will have to ask any questions EVER again. smiley.gif
 

shwetha17

Member
May 24, 2018
785
0
16
... except a plugin that wanted a newer version of xml-rpc, will compile from cvs instead of using the one from the repo. this will surely brake stuff smiley.gif
If you had looked in the tutorials , you would have know shoudl not use the repo versions
All info is in the how-to's / tutorials

Just make 100% sure you have all needed aps installed .. and then it is all a piece of cake
 

dsouvik215

Member
May 25, 2018
896
0
16
dude, you're welcome to ask questions
that's what this forum is for.


you should always compile:

xmlrpc-c
libtorrent
rutorrent

get xmlrpc-c-advanced
libtorrent/rutorrent stable

compile xmlrpc-c
compile libtorrent
compile rtorrent with xmlrpc-c
 

das329717

Member
May 25, 2018
928
0
16
Thanks, everything now works exept a working startup script. I always get the error message

Code:
cannot find readable session directory /home/torrent/torrent/.session/; from config /home/torrent/.rtorrent.rc. check permissions
when a try one of the startup script like this one: http://idarkside.co.uk/rut/rtorrent.sh (I have change the "user=" variable)
 

somus1735

Member
May 25, 2018
833
0
16
why not use cron?

it's much easier.

here is a script:
Code:
#!/bin/sh
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
SERVICE='rtorrent'
SESSION=/usr/home/$USER/.session/
FILE="${SESSION}rtorrent.lock"
HOMEDIR="/usr/home/$USER"
SIZE=95 #total %age

df $HOMEDIR| tail -1 | while read fs size used avail pcnt mount;
do
pcnt=$(echo ${pcnt} | cut -d'%' -f1 )
if [ ${pcnt} -ge $SIZE ]; then
echo "Running out of space \"${fs} (${pcnt}%)\" on ${HOSTNAME} as on $(date)"
exit 1
fi

if pgrep -u $USER $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
else
rm -f ${FILE}
echo "$SERVICE is not running, starting $SERVICE" && screen -d -m -S seedbox $SERVICE
fi
done



this script will:

check if you are over 95% full, if not, it will check if rtorrent is running.

If not, it will start rtorrent.


if you only want it to check/start (and not check space) make it:
Code:
#!/bin/sh
PATH=/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/bin:/sbin
SERVICE='rtorrent'
FILE="/usr/home/$USER/rtorrent/.session/rtorrent.lock"

if pgrep -u $USER $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
else
rm -f ${FILE}
echo "$SERVICE is not running, starting $SERVICE" && screen -d -m -S seedbox $SERVICE
fi



save it as /usr/local/bin/chktor

then
Code:
chmod +x /usr/local/bin/chktor

then add it to the user(s) crontab as:
Code:

@reboot /usr/local/bin/chktor >/dev/null 2>&1
*/5 * * * * /usr/local/bin/chktor >/dev/null 2>&1