📜 ⬆️ ⬇️

Mac Mini home server on Debian for thirty minutes for dummies

Good afternoon, habrauzer!
I read a lot of articles on the organization of the home server, I decided to add a little good.
Recently I developed for myself a universal algorithm for creating a sidbox with samba and FTP for a home network and decided to share with others. The organization of such a server takes a maximum of an hour, and in principle is suitable for any hardware.
The only condition for the successful implementation of this solution: wired internet to the server.
So let's start with the fact that I got a Mac mini PowerPC G4 in my hands, with a gigabyte of memory and a hundred gigabytes of hard disk space. A good machine for such a thing works silently, eats little electricity, takes up almost no space, has a built-in drive for DVDs.
Although this implementation is suitable for almost any other iron.
image

First you need to download from the official Debian repository net installer for your platform and burn it to disk. In my case it is powerpc.
After this, we perform a standard installation of the OS with some clarifications: you need to install only the base system and the SSH server. The rest will be set from the console. Another clarification on disk layout: I usually always select “Use entire disk” and don’t bother with LVM and manual partitioning, because all torrent downloads will be stored on the largest home partition, and the rest fits into default sections.
So, the system is installed, the network, as a rule, clings via DHCP (I make a reservation on the router for the ip for the mac address of the network card of the machine).

Well, actually the setting itself:

To manage the server through a web interface, I install Webmin .
Add the necessary libraries if they are not in the system:
apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions 


Add the Webmin repository to our server's apt:
 nano /etc/apt/sources.list 

 deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib 

')
To install Webmin using apt, you need to add an SSL key to access the Webmin repository:
 cd /root wget http://www.webmin.com/jcameron-key.asc apt-key add jcameron-key.asc 


Install Webmin, which will be accessible via the link https: // ip_ your_server: 10000 (swears on the certificate, ignore the error)
 apt-get update apt-get install webmin 


Installing a torrent client

Next, you need to configure our torrent client. The simplest and most optimal solution is Transmission , since it is configured very simply and quickly and has a client for Windows. We will install it:
 apt-get update apt-get install transmission-daemon transmission 


To configure Transmission, it uses the configuration file settings.jsonn located in / var / lib / transmission-daemon / info. Before editing it, you need to stop the Transmission, otherwise the changes made to the file while the program is running will be replaced with default ones.
 /etc/init.d/transmission-daemon stop 


Usually I only change the following parameters:
 download-dir: /home/____ rpc-password: __ rpc-username: __ rpc-whitelist-enabled:  false 


After that, you need to save the file and run Transmission:
 /etc/init.d/transmission-daemon start 


Do not forget to create the folder in the / home / directory that you specified in the Transmission settings file and give it the corresponding rights:
 mkdir /home/____ chmod 777 /home/____ 


Now you can check how Transmission works and already put something to download. To do this, simply enter in the browser address:
http: // your server_address: 9091

image

For Windows, there is Transmisson-remote-gui, it can be easily found in Google. After installing it, you need to enter the address of your server, the username and password that you specified in settings.json and set the associations of the torrent files with the new client. All downloads will be automatically added to seedbox.

image

Install samba

To access these files from the Windows network, you need to install and configure Samba . I don’t bother with the settings, as there is no server in the home network and publishing it to the outside world. Therefore, the installation algorithm will be as follows:
Install the Samba server with the ability to access files on other computers:
 aptitude install samba smbclient smbfs 


I create a backup copy of the Samba configuration file, as they say, for every fireman:
 cp /etc/samba/smb.conf /etc/samba/smb.conf.backup 


Now we edit the settings file and add the following parameters to it:
 nano /etc/samba/smb.conf 

 [global] workgroup = _____ netbios name = _ server string = __ security = share browseable = yes [share] path = /home/____ comment = mediafiles readonly = No guest ok = Yes 


Save the file and restart Samba:
 /etc/init.d/samba restart 


Now you can enter this folder by specifying Windwos \ ip__ your_server in the address bar of the explorer .

FTP Setup

If there is a desire to configure external access via FTP, then this is done as simply as all the previous ones.
Go to Webmin: https: // ip_ your_server: 10000 (swears on the certificate, ignore the error).
Go to the Webmin section -> Webmin settings, set the Russian language (in UTF-8 format). We update the page.
Go to the System -> Software Manager section, put a tick in the “Packages from APT”, indicate in the search bar proftpd, click Search in APT. After that, Webmin will install ProFTPD FTP server. We update the page and go to Services -> ProFTP Server -> Files and Directories, and specify Limit user in directories -> Home Directory. Save the changes.
Go to the System -> Users and groups. Select the user you specified as new when installing Debian Linux on your server, specifying the home directory as / home / your_folder_for_loaded_torrent. Save the settings.

To be sure, restart our freshly baked server:
 reboot 

Not to be confused with halt - this is the command to turn off the server!

Actually, this is where the home server setup is completed.
Enjoy using it!

Bibliography:
Installing Webmin on Debian
How to install Transmission in Debian / Ubuntu
Installing and configuring Samba on Debian GNU / Linux and Ubuntu Linux

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


All Articles