📜 ⬆️ ⬇️

Irrational use of Digitalocean

After distributing the packs to students, Github decided to use 100 bucks in Digitalocean with a sense, or rather as a cloud storage, rocking little things. There are not so many memories in droplets, of course (20-40 GB in budget versions), but they are just trifles that weigh a little. The usual Ubuntu 14.04 x32 was chosen as the image, transmission with its convenient web-muzzle was chosen as a rocking chair, and apache2 with webdav was taken as a method for sharing data. It turned out Yandex.Disk on steroids (ssd, torrent, swinging directly into the disk, the ability to configure more buns), but with a smaller amount of hard disk.

To begin with, a droplet with a bare system was created. Next, it was accessed via ssh and the necessary programs were installed.

sudo apt-get update sudo apt-get install apache2 transmission-daemon 

Next, a folder was created that will store the data:

 mkdir /webdav 

')
Then everything went in 2 stages: setting up apache2 and setting transmission.

Setting up apache2 was as follows:
First, apd modules related to webdav were activated for bash:

 sudo a2enmod dav sudo a2enmod dav_fs 

Then I wrote the following contents into the /etc/apache2/sites-enabled/000-defaut.conf file:

 <VirtualHost *> Alias /webdav /webdav <Location /webdav> DAV On Allow from all Satisfy any </Location> </VirtualHost> 


At the end of the setup, apache was rebooted:

 sudo service apache2 restart 

Next, the transmission was configured, it was necessary to turn off the whitelist of IP addresses and change the username and password of web muzzle users, as well as set up the zaruzok folder - / webdav (the folder we created earlier and specified in apache). The problem arose in the fact that when editing the transmission-daemon configuration, the configuration data was not saved. The problem was explained in /etc/transmission-daemon/README.json - upon exit, the configuration files were overwritten, so you first had to stop the daemon, then edit the config, then start the daemon.

 sudo service transmission-daemon stop 

Lines of the .config / transmission-daemon / settings.json file where the changes were made:

 "rpc-authentication-required": true, "rpc-whitelist-enabled": false, "rpc-username": "<username>", "rpc-password": "<password>", "download-dir": "/webdav", 


Then the daemon was launched:

 sudo service transmission-daemon start 


Everything! The server is running, the web-muzzle is available on port 9091 (can be changed in settings.json).

Further folder mounting operations differed on different systems, but overall it was something like

 mount_webdav http://<ip>/webdav /mount/<dir> 

I did not measure the droplet speed, but the 500 MB archive was downloaded in a couple of minutes, which I poured coffee.

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


All Articles