Debian Mac Mini Home Server In Thirty Minutes For Dummies

Good afternoon, habrauser!
I read many articles on organizing a home server, I decided to add a little benefit.
Recently, I developed a universal algorithm for creating a sidbox and ftp seed box 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 is: wired Internet to the server.
So, to begin with, I got the Mac mini PowerPC G4 in my hands, with a gigabyte of memory and a hundred gigabytes on my hard drive. A good machine for such a thing - it works silently, eats little electricity, practically does not take up space, has a built-in drive for DVD-ROM drives.
Although such an implementation is suitable for almost any other hardware.
image

First you need to download from the official Debian net installer repository for your platform and burn it to disk. In my case, it is powerpc.
After that, we perform the standard installation of the OS with some clarifications: you need to install only the base system and the SSH server. We will put the rest from the console. Another refinement on disk layout: usually I always select “Use the 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 the default partitions.
So, the system is installed, the network, as a rule, clings to DHCP (I make an IP reservation on the router for the mac address of the machine’s network card).

Well, actually the setting itself:

To manage the server through the web-based 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 the apt of our server:
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 available at https: // ip_your_server_name: 10000 (swears on the certificate, ignore the error)
apt-get update
apt-get install webmin


Torrent client installation

Next, you need to configure our torrent client. The simplest and best solution is Transmission , because 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


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


Usually I change only 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 appropriate rights:
mkdir /home/ваша_папка_для_скаченных_торрентов
chmod 777 /home/ваша_папка_для_скаченных_торрентов


Now you can check how Transmission works and already put something to download. To do this, just enter the address in the browser:
http: // yourserver_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 the sidebox.

image

Install Samba

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


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


Now 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 in the address bar of the Explorer Windwos \\ ip_your_server

FTP setup

If there is a desire to configure external access via FTP, then this is done as easily as all the previous ones.
We go to Webmin: https: // ip_your_server_name: 10000 (swears on the certificate, ignore the error).
Go to the section Webmin -> Webmin settings, set the Russian language (in UTF-8 format). We are updating the page.
We go to the System -> Software Manager section, put a tick in “Packages from APT”, indicate proftpd in the search bar, click Search in APT. After that, Webmin will install the FTP server ProFTPD for us. We refresh the page and go to Services -> ProFTP Server -> Files and Directories, and specify Restrict user to directories -> Home directory. Save changes.
Go to System -> Users and Groups. We select the user that you indicated as new when installing Debian Linux on your server, specify the home directory as / home / your_folder_for_ downloaded torrents. Save the settings.

For fidelity, we restart our freshly baked server:
reboot

Not to be confused with halt - this is a command to shut down the server!

Actually this completes the configuration of the home server.
Enjoy your use!


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

Also popular now: