Questa è una guida che spiega come installare il client BitTorrent rTorrent e un’interfaccia Web per rTorrent, wTorrent, sul vostro dispositivo NAS Synology.
SOLO PER I SEGUENTI MODELLI:
DS107+ (64 o 128MB di RAM)
DS207+
CS407
RS407 1 - Installazione di ipkg:Se avete già installato ipkg, saltate al punto 2 altrimenti digitate:
Ora modificate da dove ipkg, prende i pacchetti digitando:
Codice:vi /opt/etc/ipkg.conf
A questo punto siete nell'editor e dovete sostituire la prima riga:
Con questa:
Digitate:
2 - Installazione pacchetti necessari:Al momento di scrivere questa guida (15 maggio 2008), c'è un bug nel pacchetto xmlrpc-c (xmlrpc-c v1.11.00-3).
Ecco perché è necessario prima installare la vecchia libreria (xmlrpc v1.11.00-c-2).
Per fare questo digitate:
Codice:vi /opt/etc/ipkg.conf
A questo punto siete nell'editor e dovete sostituire la prima riga:
Con questa:
Digitate:
Ora potete installare xmlrpc-c da Maarten utilizzando i seguenti comandi:
Codice:ipkg install xmlrpc-c
Una volta fatto questo, è possibile rimuovere il feed Maartens e riattivare il feed optware digitando:
Codice:vi /opt/etc/ipkg.conf
A questo punto siete nell'editor e dovete sostituire la prima riga:
Con questa:
Digitate:
Installare il resto dei pacchetti da optware:
Codice:ipkg install rtorrent php php-fcgi php-curl libcurl lighttpd sqlite svn screen
3 - RTORRENTScaricate il nostro file di esempio /root/.rtorrent.rc digitando:
Codice:wget -O /root/.rtorrent.rc 'http://www.synologyitalia.com/upload/rtorrent.rc'
Nel file di esempio .rtorrent.rc sono state usate le seguenti directory:
directory = /volume1/public/rt/
session = /root/.rtorrent
Ora dovete creare le due directory digitando:
Codice:mkdir /volume1/public/rt
mkdir /root/.rtorrent
4 PHPSi devono abilitare due estensioni in PHP in modo che wTorrent sia in grado di scrivere nell user-database.
Codice:vi /opt/etc/php.ini
e aggiungere al gruppo delle estensioni abilitate che si trova alla riga 545 le seguenti estensioni:
Codice:extension=sqlite.so
extension=pdo.so
5 - lighttpd Dovete abilitare mod_fastcgi e mod_scgi in /opt/etc/lighttpd/lighttpd.conf se non sono già abilitati.
Attenzione "mod_scgi", non c'è dovete aggiungerlo dopo "mod_fastcgi",.Basta rimuovere # all'inizio della linea (decommentare)
Digitate:
Codice:vi /opt/etc/lighttpd/lighttpd.conf
Vedrete qualcosa di simile a questo verso la riga 15. (Doverte togliere # da davanti a mod_fastcgi e mod_scgi):
Codice:server.modules = (
......
"mod_access",
.......
"mod_fastcgi",
.......
"mod_scgi",
.......
)
La seconda cosa che dovete fare per lighttpd è di aggiungere il soket scgi.
Aggiungete le seguenti righe alla fine di /opt/etc/lighttpd/lighttpd.conf digitando:
Codice:vi /opt/etc/lighttpd/lighttpd.conf
Codice:scgi.server = (
"/RPC2" =>
( "127.0.0.1" =>
(
"socket" => "/root/.rtorrent/rpc.socket",
"check-local" => "disable",
"disable-time" => 0,
)
)
)
Riavviare lighttpd digitando:
Codice:/opt/etc/init.d/S80lighttpd restart
6 - wtorrentDigitate:
Codice:cd /opt/share/www/lighttpd
Scaricate la versione più recente di wTorrent utilizzando svn:
Codice:svn co svn://wtorrent-project.org/repos/trunk/wtorrent/
Copiate il file configurazione di esempio digitando:
Codice:cd wtorrent
cp conf/sample.home.conf.php conf/home.conf.php
Modificatelo in modo più adatto alle vostre necessità.
Digitando:
Codice:vi conf/home.conf.php
Modificate dalla riga 22
Codice:define( 'URL', 'http://diskstation:8081/wtorrent/' );
define( 'BASE', 'http://diskstation:8081/wtorrent/' );
E dalla riga 29:
Codice:
define( 'RT_HOST', 'localhost');
define( 'RT_PORT', 8081);
define( 'RT_DIR', 'RPC2/');
define( 'RT_AUTH', false);
define( 'RT_USER', 'my_user');
define( 'RT_PASSWD', 'my_password');
E alla riga 43:
Codice:define( 'DIR_EXEC', '/opt/share/www/lighttpd/wtorrent/');
Alla riga 49 dovete definire la directory da dove scaricate i file.
Codice:define( 'DIR_DOWNLOAD', '/volume1/video/tmp/');
7 - Configurare S99rtorrentQuesto file fa avviare automaticamente rtorrent all'accensione del vostro NAS Synology.
L'installazione di rtorrent ha creato il file /opt/etc/init.d/S99rtorrent.
È necessario modificarlo (sostituire le righe rosse con quelle verdi)
Digitate e sostituite le righe rosse con le verdi:
Codice:vi /opt/etc/init.d/S99rtorrent
#dirlayout=RTORRENT_DEFAULTdirlayout=CUSTOMuser="p2p"user="root"config="/opt/etc/rtorrent.conf"config="/root/.rtorrent.rc"logfile="/opt/var/log/rtorrentInit.log" logfile="/root/rtorrentInit.log" SCRIPTNAME=/etc/init.d/$NAME SCRIPTNAME=/opt/etc/init.d/$NAME for i in `echo "$PATH" | tr ':' '\n'` ; do
if [ -f $i/$NAME ] ; then
exists=1
break
fi
done#for i in `echo "$PATH" | tr ':' '\n'` ; do
# if [ -f $i/$NAME ] ; then
exists=1
# break
#fi
#done [ -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 if [ -e /root/.rtorrent/rpc.socket ] || [ -e /root/.rtorrent/rtorrent.lock ] ; then
echo "."
echo "rtorrent has not been properly stop."
echo "Deleting locked files ..."
rm -rf /root/.rtorrent/rpc.socket
rm -rf /root/.rtorrent/rtorrent.lock
echo -n "Done"
fi
if [ -e /root/.rtorrent/rpc.socket ] || [ -e /root/.rtorrent/rtorrent.lock ] ; then
echo "."
echo -n "Locked files not deleted, please check .."
fi
stty stop undef && stty start undef
[ -d "${base}" ] && cd "${base}"
# 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
su -c "screen -d -m rtorrent ${options} 2>&1 1>/dev/null" ${user} | tee -a "$logfile" Ora siete in grado di utilizzare S99rtorrent con gli argomenti start | stop | restart.
Se qualcosa va storto un'occhiata nel file di log in /root/rtorrentInit.log.
Non dimenticare di fare il backup /opt/etc/init.d/S99rtorrent, perché verrà sovrascritto se installate nuove versioni di rtorrent.
Se rTorrent non si avvia, controllare se i seguenti file esistono: /root/.rtorrent/rpc.socket e /root/.rtorrent/rtorrent.lock, se esitono cancellateli digitando:
Codice:rm /root/.rtorrent/rpc.socket
rm /root/.rtorrent/rtorrent.lock
8 - Fate partire tuttoFate il reboot del NAS Synology digitando:
Attendete che il NAS si riavvii e quindi digitate:
Codice:/opt/etc/init.d/S99rtorrent start
Se volete entrare in rTorrent digitate da putty:
Per uscire da rTorrent lasciandolo in funzione digitate contemporaneamente i tre tasti ctrl+a+d.
Riavviare lighttpd digitando:
Codice:/opt/etc/init.d/S80lighttpd start
9 Come usare wTorrentSul il vostro browser digitate:
Codice:http://diskstation:8081/lighttpd/wtorrent (o forse http://diskstation:8081/wtorrent per le versioni più vecchie).
Creare un utente / password digitando utente e password (quello che volete).
Se ricevete un errore wTorrent è già stato configurato", eliminare il file /opt/share/www/lighttpd/wtorrent/db/database.db digitando:
Codice:rm /opt/share/www/lighttpd/wtorrent/db/database.db