📜 ⬆️ ⬇️

Ubuntu Server on a home computer. Distribute the Internet, download torrent

Recently, home servers used to store content, download torrents, and just to distribute the Internet are becoming more and more popular. Not so long ago, inspired by reviews of home servers, a home server was assembled from improvised means:

Hard Drive: 500Gb
478 socket motherboard
Processor: Pentium 4 - 2.6Ghz HT
All this in an old building ...
image
So, what we have:
• Home server
• City local area network issuing Internet via VPN connection

Tasks:


Use server as content storage
The ability to download torrents
Distributing the Internet to the whole family via VPN
')


Configure VPN connection.



, , . Ubuntu Server.
, SSH .
, Putty
, , VPN .
pptp-linux, , .
, .
$ sudo dpkg -i pptp-linux_1.7.2-1_i386.deb

, /etc/ppp/chap-secrets (LOGIN), (PASSWORD), (PROVIDER_NAME)

LOGIN PROVIDER_NAME PASSWORD *

, /etc/ppp/peers/PROVIDER_NAME , :
remotename PROVIDER_NAME
pty "pptp --loglevel 1 PROVIDER_VPN_ADRESS --nolaunchpppd"
name LOGIN
noauth
nodetach
lock
defaultroute
replacedefaultroute
noccp


PROVIDER_VPN_ADRESS — VPN , LOGIN —
, VPN ,

$sudo pon PROVIDER_NAME

, IP , , , :)

, /etc/rc.local.

pon PROVIDER_NAME

, , , / .

VPN .



VPN , :)
VPN PPTP-.
, . PPTP .

$sudo apt-get install ppp pptpd

. /etc/pptpd.conf :
# IP-
localip 10.10.3.231

# PPTP-
remoteip 172.22.1.1-5


/etc/ppp/pptpd-options :
#
auth

#
require-mppe


, , /etc/ppp/chap-secrets :
LOGIN pptpd PASSWORD "172.22.1.1"
LOGIN2 pptpd PASSWORD2 "172.22.1.2"


: IP- remoteip pptpd.conf, :

LOGIN pptpd PASSWORD "*"

, /etc/rc.local:

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo "1" > /proc/sys/net/ipv4/ip_forward


, :

$sudo reboot

. VPN , IP /, /etc/ppp/chap-secrets.

rTorrent wTorrent

, :
$sudo apt-get install apache2 php5 php5-xmlrpc rtorrent php5-sqlite sqlite libxmlrpc-c3 libapache2-mod-scgi screen subversion

,

$sudo nano /etc/apache2/sites-available/default

2 :

LoadModule scgi_module /usr/lib/apache2/modules/mod_scgi.so
SCGIMount /RPC2 127.0.0.1:5000


apache:

$sudo /etc/init.d/apache2 restart

«torrent». , RTorrent.

sudo useradd torrent -p password -d /home/torrent

, rTorrent

$sudo nano /home/torrent/.rtorrent.rc

:

port_range = 6925-6925
directory = /home/torrent/torrents/download/
session = /home/torrent/torrents/session/
schedule = watch_directory,5,5,load_start=/home/torrent/torrents/watch/*.torrent
scgi_port = 127.0.0.1:5000
hash_read_ahead = 32
hash_max_tries = 1
hash_interval = 1


rTorrent,

,

$sudo wget libtorrent.rakshasa.no/attachment/wiki/RTorrentCommonTasks/rtorrentInit.sh?format=raw -O /etc/init.d/rtorrent



$sudo nano /etc/init.d/rtorrent

user=«user» user torrent ( , RTorrent, useradd)

rTorrent — :

$sudo chmod +x /etc/init.d/rtorrent
$sudo update-rc.d rtorrent defaults


:

$sudo /etc/init.d/rtorrent start

— WTorrent:

$ cd /var/www
$ sudo svn co svn://wtorrent-project.org/repos/trunk/wtorrent


ip-/wtorrent/install.php .
. , , .
— . ,

FTP



ftp vsftpd.

$sudo apt-get install vsftpd

:

$sudo nano /etc/vsftpd.conf

...
write_enable=YES
anonymous_enable=NO
local_enable=YES
...


vsftpd:

/etc/init.d/vsftpd

, .

$sudo reboot



, , :)
. !

Tanto, AusTiN! , , :(

Source: https://habr.com/ru/post/80258/


All Articles