A home server is just ... a computer running 24 hours, 7 days a week, 365 days a year. What is he doing?
"Distributes" the Internet by wire and by air.
It is a warehouse with round-the-clock access to all of your collections of movies, music, games, programs, backups of important information. him Liked? Do you want to "make" similar at home?
Here I recall the phrase from the anecdote - "The main thing, guys, do not be afraid!".
There are several steps to creating your own home server:
- You must decide on the OS [operating system]
- Buy / find components for the server itself
- Get plenty of patience, prepare 33 tabs with a Google search engine for questions about why this or that does not work [but everything should work: P]
We will understand.
The item number is added only to indicate that you have a choice, but since the orientation of my blog is focused on Linux, in the article, everything will be considered on the basis of this operating system. Perhaps, if it makes sense and it will be needed by people, there will be an option to describe how to create a home server on Windows.
')
Item number two. It should immediately be said that the version of the home server on the Windows OS requires more power from the components than on the Linux OS. In my case, my personal home server is based on a Pentium 4, 1000MHz, 1Gb RAM.
Item number three. It should immediately make a reservation that the article is designed for a “not-quite-new” player, but for users who have communicated with Linux and in general with a computer.
In this article we will consider the home server on the example of the OpenSUSE OS.
What do we do:
- DHCP Server - in order to distribute ip addresses to computers on the network, so we get a home network.
- WiFi AP - to have a WiFi access point, that is, you can put a home WiFi router in the closet.
- FTP Server - to access file storage from the Internet.
- Samba - to access file storage within the network.
- TorrentClient - semi-automated torrent rocking on your home server.
Start by installing the system. The process is trivial and simple. Almost how to install Windows.

Figure 1. Installing openSUSE 11.4.
Click "Next", select the desired items, language, keyboard layout, and so on. We will not linger separately, this stage is simple.

Figure 2. System installation process.
After installing the system, you will get a practically naked system (although, in fact, there is a lot of rubbish and garbage in it, unnecessary programs, libraries). As soon as the system is booted for the first time - reboot, if there are errors, it will immediately come out. Get to work.
To get started, look at the network settings, type in the console:
ifconfig
and see the output command. Your network interfaces and information about them will be listed there:

Figure 3. Output of the ifconfig command
eth0 (internet) and
eth1 (lan) - interfaces of the usual network cards,
eth0 plug in the cable with the Internet, and from
eth1 the cord goes to the switch,
wlan0 - the WiFi card interface,
lo - the back loop,
mon.wlan0 - you will learn about this interface later, in another article or in the same, but below. Now it is immediately necessary to plug the cord from which the Internet flows to that network card (in this article it is eth0), into which it will always be plugged in and not to confuse them. Now, open the console and write:
nano /etc/sysconfig/network/ifcfg-eth1
The
eth1 interface configuration file will open (the one for the local network), and write the following there:
BOOTPROTO='static' IFPLUGD_PRIORITY='0' IPADDR='192.168.1.1/24' STARTMODE='ifplugd' USERCONTROL='no'
Save (key combination Ctrl + O) and open the following file
/ etc / sysconfig / network / ifcfg-wlan0 - the wireless interface config, write the following there:
BOOTPROTO='static' IFPLUGD_PRIORITY='0' IPADDR='192.168.2.1/24'
This completes the preparation of network cards. You can read about these functions in the
ifcfg-template file. The same settings can be made from the interface, it is enough to open Start-YAST-Network settings and change the IP addresses and other options for all available interfaces.
All done, good. We proceed to further configuration.
DHCP server. The service is called
dhcpd , with the standard installation of the system, it is already included in the repository of the system, it only needs to be included:
etc/init.d/dhcpd start/
The main DHCP server configuration file is located at
/etc/dhcpd.conf . It is necessary to edit it. Complete information on the teams, you can get by writing the following in the console:
man dhcpd
For editing configuration files [further, config] files I use text editor
nano , you can also use
vim .
I suggest to look at the working config file of the DHCP server for clarity:
The config file was previously provided with explanatory comments. This is an example of a simple but quite working DHCP server. Also, you need to edit the
/ etc / sysconfig / dhcpd file, namely one line -
DHCPD_INTERFACE = "" , here we enter the interfaces for the wireless subnet and the wired subnet, that is, the very interfaces that we specified in the config file of the DHCP server -
/ etc /dhcpd.conf in
INTERFACES lines
= "" . After that, it is necessary to reboot the system.
At this, editing the config file of the DHCP server is complete, if you insert the Internet cable into the server (
eth0 ), and insert the other wire into the switch and from the switch into your computer, the DHCP server will give you the address from the selected range.
HostAP - we begin to configure the distribution of WiFi.
The first thing you need is a wifi-network card company, in this article everything will be described with the condition that the network card is a Realtek company, since it is the most common. You need to download and install the
hostapd utility, initially when installing from the repository it is compiled without
nl80211 driver
support , so you need to compile it from source, with the support of the required driver included (on the atheros network cards - the hostapd should work downloaded from the repository) . You also need to download the
binutils utility
package , this can be done by running the following command in the terminal:
zypper in binutils
After installing the utilities, you must configure the hostapd service, the whole configuration process consists of editing the configuration file
/etc/hostapd.conf , the location of this file can be changed in the
/ etc / default / hostapd file .
Just above is an example of a working config. Read more about the configuration process and additional options in man'e.
man hostapd
The next step is to start the hostapd service in the WiFi distribution mode. To do this, we write a command in the terminal:
hostapd -B /etc/hostapd.conf
Voila, we get the output from the console that WiFi distribution is running from such and such MAC address and with such SSID:
Configuration file: /etc/hostapd.conf Using interface wlan0 with hwaddr 00:17:31:ed:cb:52 and ssid 'myssid'
Above, you can see the output of the Internet distribution command via WiFi, that is, the successful launch of the hostapd service in “daemon” mode, that is, the background operation of the service does not depend on the open terminal window in which you started the service.
At the moment, you will have a full-fledged WiFi router that can distribute the Internet over the wire and over the air. Next, we will organize file storage available inside the network, outside (from the Internet), semi-automated torrent rocking, also talk about setting up daily / weekly backups of information using the scheduler and much more to improve the functionality of the home server, increase the automation of many processes, but in other articles and notes. Thanks for attention!