Spis treści
- 1. Tworzymy nowego użytkownika „rtorrent” i nowy katalog domowy.
- 2. Instalacja programów i paczek.
- 3. Instalacja i włączanie modułu scgi.
- 4. Instalacja XMLRPC.
- 5. Instalacja rTorrent.
- 6. Tworzenie folderów potrzebnych do poprawnego funkcjonowania rTorrenta.
- 7. Pobranie pliku z gotową konfiguracją .rtorrent.rc.
- 8. Instalacja ruTorrent.
- 9. Tworzenie konfiguracji i zabezpieczanie dostępu do strony hasłem.
- 10. Zabezpieczanie foleru SCGI (/RPC2).
- 11. Instalacja Screen.
- 12. Dostęp do strony.
Important!
Testowane na:
Ubuntu 14.04-1
rTorrent wersja: 9.4,
Libtorrent wersja: 13.4
Xmlrpc: svn.
ruTorrent 3.5 – 3.6.
Instalacja serwera apache2:
http://pl.terminal28.com/instalacja-i-konfiguracja-apache-php5-ruby-python-webdav
Dodanie użytkownika do /etc/sudoers.
su
hasło root’a.
nano /etc/sudoers
Przykład:
nazwa_użytkownika ALL=(ALL) ALL
1. Tworzymy nowego użytkownika „rtorrent” i nowy katalog domowy.
Katalog domowy: /opt/rtorrent.
sudo adduser --home /opt/rtorrent rtorrent
2. Instalacja programów i paczek.
sudo apt-get update sudo apt-get upgrade
sudo apt-get install subversion build-essential automake libtool libcppunit-dev libcurl3-dev sudo apt-get install libsigc++-2.0-dev libcppunit-dev unzip unrar-free curl libncurses-dev sudo apt-get install apache2 apache2-utils php5 php5-cli php5-curl php-xml-rss php5-xmlrpc sudo apt-get install php5-sqlite sqlite libapache2-mod-php5 libapache2-mod-xsendfile
3. Instalacja i włączanie modułu scgi.
sudo apt-get install libapache2-mod-scgi ln -s /etc/apache2/mods-available/scgi.load /etc/apache2/mods-enabled/scgi.load sudo /etc/init.d/apache2 restart
4. Instalacja XMLRPC.
cd $HOME sudo mkdir install cd install sudo svn checkout http://svn.code.sf.net/p/xmlrpc-c/code/stable xmlrpc-c cd xmlrpc-c sudo ./configure --disable-cplusplus sudo make sudo make install
5. Instalacja rTorrent.
5.1. Instalacja bibliotek Libtorrent.
cd .. sudo wget https://github.com/rakshasa/libtorrent/archive/0.13.4.tar.gz -O libtorrent-0.13.4.tar.gz sudo tar xvf libtorrent-0.13.4.tar.gz cd libtorrent-0.13.4 sudo ./autogen.sh sudo ./configure sudo make sudo make install
5.2. Instalacja rTorrent.
cd .. sudo wget https://github.com/rakshasa/rtorrent/archive/0.9.4.tar.gz -O rtorrent-0.9.4.tar.gz sudo tar xvf rtorrent-0.9.4.tar.gz cd rtorrent-0.9.4 sudo ./autogen.sh sudo ./configure --with-xmlrpc-c sudo make sudo make install sudo ldconfig
6. Tworzenie folderów potrzebnych do poprawnego funkcjonowania rTorrenta.
sudo mkdir -p /opt/rtorrent/{session,watch,download} sudo chmod 777 -R /opt/rtorrent/{session,watch,download} sudo chown rtorrent:rtorrent -R /opt/rtorrent/{session,watch,download}
7. Pobranie pliku z gotową konfiguracją .rtorrent.rc.
sudo wget "http://pl.terminal28.com/download/rtorrent.rc" -O /opt/rtorrent/.rtorrent.rc
sudo chmod 777 /opt/rtorrent/.rtorrent.rc
8. Instalacja ruTorrent.
8.1. ruTorrent via GIT.
sudo apt-get install git sudo git clone https://github.com/Novik/ruTorrent.git /var/www/rutorrent/ sudo chown -R www-data:www-data /var/www/rutorrent
LUB
8.2. ruTorrent ver. 3.7.
cd .. sudo wget https://bintray.com/artifact/download/novik65/generic/ruTorrent-3.7.zip sudo unzip ruTorrent-3.7.zip sudo mv ruTorrent-master /var/www/rutorrent sudo chown -R www-data:www-data /var/www/rutorrent
LUB
8.3. ruTorrent ver. 3.6.
cd .. sudo wget http://dl.bintray.com/novik65/generic/rutorrent-3.6.tar.gz sudo tar xvf rutorrent-3.6.tar.gz sudo mv rutorrent /var/www sudo wget http://dl.bintray.com/novik65/generic/plugins-3.6.tar.gz sudo tar xvf plugins-3.6.tar.gz sudo mv plugins /var/www/rutorrent sudo chown -R www-data:www-data /var/www/rutorrent
LUB
8.4. ruTorrent ver. 3.5.
cd .. sudo wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/rutorrent/rutorrent-3.5.tar.gz sudo tar xvf rutorrent-3.5.tar.gz sudo mv rutorrent /var/www sudo wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/rutorrent/plugins-3.5.tar.gz sudo tar xvf plugins-3.5.tar.gz sudo mv plugins /var/www/rutorrent sudo rm -rf /var/www/rutorrent/plugins/darkpal sudo chown -R www-data:www-data /var/www/rutorrent
8.5. ruTorrent mobile.
Dostęp do ruTorrent, rTorrent z tel. iPhone i starszych modeli tel. innych firm. http://pl.terminal28.com/dostep-do-rutorrent-rtorrent-z-tel-iphone-i-starszych-modeli-tel-innych-firm Dostęp do ruTorrent, rTorrent z tel. z systemem Android. http://pl.terminal28.com/rtorrent-transdroid-dostep-do-rtorrenta-z-telefonu
Zmiana ustawień odnośnie informacji o zajętości dysku/katalogu do którego ściągamy pliki.
Edytujemy plik konfiguracyjny ruTorrent’a i zmieniamy ścieżkę do dysku/katalogu do którego ściągamy pliki. Zastępujemy sciężkę do katalogu root „/” katalogiem ze ściagniętymi plikami.
sudo nano /var/www/rutorrent/conf/config.php
$topDirectory = '/opt/rtorrent/download'; // Upper available directory. Absolute path with trail slash.
Od tego momentu w lewym dolnym rogu ruTorrent będzie pokazywał prawidłową informacje o zajetości dysku/katalogu.
8.6. Instalacja pluginu mediainfo.
sudo apt-get install mediainfo
Tworzenie symlinku aplikacji ffmpeg do aplikacji avconv. Ffmpeg został uznany za przestarzałą aplikację i zastąpiony został przez avconv.
sudo ln -s /usr/bin/avconv /usr/bin/ffmpeg
8.7. Instalacja GeoIP i ffmpeg.
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz sudo gunzip GeoLiteCity.dat.gz sudo mkdir -v /usr/share/GeoIP sudo mv -v GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat sudo apt-get install php5-geoip libav-tools
sudo ln -s /usr/bin/avconv /usr/bin/ffmpeg
9. Tworzenie konfiguracji i zabezpieczanie dostępu do strony hasłem.
cd /var/www/rutorrent
Tworzenie pliku z szyfrowanym hasłem .htpasswd
sudo htpasswd -c /var/www/rutorrent/.htpasswd nazwa_użytkownika
Edytujemy plik /var/www/rutorrent/.htaccess i dodajemy wpis, który informuje apache2 o plikach i lokalizacjach chronionych hasłem.
sudo nano /var/www/rutorrent/.htaccess
...
AuthUserFile /var/www/rutorrent/.htpasswd AuthName "ruTorrent_login" AuthType Basic require valid-user
...
Tworzenie dostępu do strony
Edytujemy /etc/apache2/sites-available/default i dodajemy wpis, który informuje apache2 o plikach i lokalizacjach chronionych hasłem (wytłuszconym drukiem).
sudo nano /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly. #ServerName www.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf </VirtualHost>
sudo cat << EOT > /etc/apache2/sites-available/rutorrent
# ruTorrent
#===========================================================================
<VirtualHost *:80>
DocumentRoot /var/www/rutorrent/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>
#===========================================================================
EOT
sudo ln -s /etc/apache2/sites-available/rutorrent /etc/apache2/sites-enabled/rutorrent
Dodajemy nazwę serwera do konfiguracji Apache2 np: localhost(na samym dole).
sudo nano /etc/apache2/apache2.conf
ServerName localhost
Włączamy moduły auth_digest i authn_file:
sudo a2enmod auth_digest sudo a2enmod authn_file
Restart apache2:
sudo /etc/init.d/apache2 restart
10. Zabezpieczanie foleru SCGI (/RPC2).
Tworzenie folderów: passwords-available, passwords-enabled w /etc/apache2.
sudo mkdir -p /etc/apache2/passwords-{available,enabled}
Przechodzimy do folderu /etc/apache2/passwords-available aby utworzyć nowe hasło do SCGI.
cd /etc/apache2/passwords-available
sudo htpasswd -c rtorrentscgi nazwa_użytkownika
Linkujemy folder passwords-available do passwords-enabled.
cd ../passwords-enabled sudo ln -s ../passwords-available/rtorrentscgi
Edytujemy plik /etc/apache2/sites-available/rtorrentscgi i dodajemy wpis, który informuje apache2 o plikach i lokalizacjach SCGI chronionych hasłem.
sudo cat << EOT > /etc/apache2/sites-available/rtorrentscgi
#rTorrent lokalizacja hasła do SCGI #=========================================================================== <LocationMatch "/RPC2"> AuthType Basic AuthName "rtorrentscgi" AuthUserFile /etc/apache2/passwords-enabled/rtorrentscgi Require valid-user BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On Order allow,deny Allow From all </LocationMatch> #===========================================================================
# SCGI PORT #=========================================================================== #LoadModule scgi_module /usr/lib/apache2/modules/mod_scgi.so SCGIMount /RPC2 127.0.0.1:5000 #=========================================================================== EOT
sudo ln -s /etc/apache2/sites-available/rtorrentscgi /etc/apache2/sites-enabled/rtorrentscgi
Restartujemy apache2.
sudo /etc/init.d/apache2 restart
11. Instalacja Screen.
sudo apt-get install screen
Uruchomienie sesji rTorrenta w tle
screen -fa -d -m rtorrent
Test nasłuchiwania rtorrenta:
sudo netstat -npl | grep rtorrent
Prawidłowa odpowiedź..
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 6642/rtorrent tcp 0 0 0.0.0.0:6892 0.0.0.0:* LISTEN 6642/rtorrent
Automatyczne uruchamianie rTorrenta wraz ze startem systemu (serwera) oraz możliwość zatrzymywania, restartowania, i uruchamiania programu.
Pobieramy skrypt i umieszczamy go w folderze /etc/init.d/.
sudo wget "http://pl.terminal28.com/download/rtorrent" -O /etc/init.d/rtorrent
sudo chmod 777 /opt/rtorrent/.rtorrent.rc
Następnie edytujemy skrypt, zastępujemy nazwę user nazwą użytkownika rtorrent.
sudo nano /etc/init.d/rtorrent
...
user="rtorrent"
...
sudo chmod +x /etc/init.d/rtorrent sudo update-rc.d rtorrent defaults sudo /etc/init.d/rtorrent start
Podczas następnego startu systemu (serwera) rTorrent zostanie automatycznie uruchomiony w sesji screen’a
Komendy:
sudo /etc/init.d/rtorrent start - uruchamianie sudo /etc/init.d/rtorrent stop - zatrzymywanie sudo /etc/init.d/rtorrent restart - restart
12. Dostęp do strony.
http://adres_IP/rutorrent
lub
http://twoja_domena/rutorrent
Powinieneś być poproszony o nazwę użytkownika i hasło
Źródło:
http://rakshasa.github.io/rtorrent/
http://code.google.com/p/rutorrent/
http://code.google.com/p/avalanche-rt/
Notice
Jeśli ten artykuł pomógł Ci, masz co do niego jakieś wątpliwości lub pytania „Zostaw komentarz”, a na pewno na niego odpowiem.
Wspomóż rozwój tego serwisu darowizną:
Wszelkie pozyskane fundusze idą na opłacenie miesięcznego abonamentu za sprzęt na, którym stoi serwer.
1 ping
[…] http://pl.terminal28.com/instalacja-i-konfiguracja-rutorrent-rtorrent-libtorrent-xmlrpc-screen-ubunt… […]