Categories

 Edit Translation
by Transposh - translation plugin for wordpress
IPv6 logo

Home Web Server -Introduction

The following series of entries will describe the installation and startup process of a personal web server that works from home and can be universally accessed. In this post we will discuss the equipment to use, The operating system, initial component installation and initial network configuration.

Purpose

Purpose.

A server is a machine that is always ready to offer data and information to the devices that connect to it., if you connect to the Internet we can access this data from any part of the world at any time. Although there are very useful solutions such as Google or Microsoft cloud services, these offer us a fairly limited amount of storage, that in some cases it may be insufficient, the use of a personal server complements these services since the storage capacity will be what we want to have in the devices that we install. It is also attractive the idea of ​​being able to totally configure to our liking the services and pages that we can serve, thing that hiring a VPS is expensive if we do not expect to have many visits or immediate return, or if we use preconfigured services we will not have sufficient customization capacity of our server.

We will not only be able to access pages, but documentation, multimedia, and home automation services if we want to install them, in a safe and economical way. A frequent solution is usually a web server with documentation, an FTP to access and upload the data and a multimedia server with our favorite music to listen to at home and abroad. Can be expanded, if the cost of more powerful hardware is considered convenient to offer conferences and serve video on demand. Video surveillance services can be included at a lower cost, sensores climáticos y todo tipo de ingenios a través de placas tipo “Pi” and Arduino.

Requirements

Requirements.

Broadband Internet access, the more bandwidth the better, thus the server will not interfere in the normal use of the network.

A dedicated computer, a high performance machine is not necessary, in fact a low energy consumption is recommended. The most important requirements will be the more RAM memory the better, and hard drives as fast as possible, SSD better, but if we want large capacity, hybrids work well at very reasonable prices. screen, mouse and keyboard only for initial setup, after that we will access the server from an ssh console.
A ventilated and quiet place in the house to put the server, will be on 24 hours, so it is not recommended to leave it in a bedroom or bathroom.
It is advisable to have a domain name, but you can also use a free dynamic one.
Application:

We will start with the simplest, a web server and programs to control and secure it as easily as possible. We will avoid as far as possible resort to the command console, although we will add the equivalent commands and explanations of their use. Everything that can be done with a user interface, can be done with the console, sometimes even better, but it certainly is not necessary for a personal project and for all audiences like this.

First steps

First steps.

The machine that I am going to use as a server is a donation from Cala, modified with a consumer 35W AMD motherboard that I found in the trash and 16GB of DDR3 RAM that I bought at a very good price on Ebay. The micro is an AMD 3850 APU with built-in graphics that consumes very little, corre a un máximo de 1,3 GHz and it has four cores what for a small server, who will not be given much burden, it is always important because speed is not as necessary as the ability to do several things at the same time.

The chosen operating system is Debian 10, free and without license problems. It is one of the most used on web servers due to its stability, extensive documentation and active community on the support. It is easy to find effective solutions to the problems that arise, thanks to its wide implementation.

As a web server I chose Apache, Nginx is the other option available, and you can also use both at the same time to speed up the loads a little, but for now it will not be necessary to complicate.

To administer the server we will use a combination of SSH with X11 forwarding to use a comfortable graphical environment, which will be XFCE4 for its lightness and Webmin, a simple and powerful web administration tool that will allow us to control many aspects of the server.

I use an IPV6 address, that can be made fixed and unique, since IPV4 addresses are practically exhausted and although we will use a dynamic that assigns us from the Internet provider, not necessary.

To access from outside, we will see how to configure DNS records to point to the server, We will see how to register an alternative TLD in Open NIC and how to use a dynamic DNS service and a subdomain.

Hardware

Hardware Preparation.

All you have to do is find a place and connect the cables. The only cable that we should pay attention to is the network cable, if the router is far, we can make our own that goes from the router to the computer. We can make the ñapa ourselves if we feel encouraged, ask friends for help or hire a technician to install the wiring.

 

Software

The software.

We will use a series of programs to serve web pages and configure the machine, muchos no vienen preinstalados así que los iremos instalando antes de abrir el servidor a la red.

SSHD, the daemon to access the server operation and administration console.
Apache. The web server itself, is powerful, quick and easy to configure.
Xorg, XFCe4, lightgdm. The graphical environment, can be used remotely.
Webmin. Control and configuration tool for web servers, greatly facilitates system maintenance, its services, registers and extra settings.
UFW y GUFW. Firewall management tools, Linux firewall is quite complicated to use, this tool simplifies it very effectively.
Geany. Powerful programming editor, it will come in handy when it comes to playing configuration files.
MC (Midnight Commander). Console tool to navigate and manipulate the file system. While using commands is faster, this tool makes file manipulation and editing very comfortable, copy, mover, decompress, permission changes and various tweaks. Combined with the console it is the ideal tool to deal with files in Linux.
HTOP. Simple and powerful task manager.
Synaptic. Graphical software package management tool, very easy to use, complements the command line when we are missing a package and we do not know exactly its name.
Clamav. Although few, hay virus for linux, Prevention is better than cure.
Fail2Ban. Essential, tool to stop malicious system entries. Along with the firewall it is the first defense barrier, and it's hard. There are other tools, but they will not be necessary in a private and little traveled environment.
Glogg. Log file viewer, It is graphical and can have several open at the same time when we want to see what is happening in the system.
The rest of the tools generally come pre-installed., and if we want we can add more to our convenience.

Debian, in its basic network installation it allows to install the software that we will need for the server. The first thing is to download an installation image from their website.

Once the image is downloaded we will use Rufus to make a boot disk, yumi, which is very good for other distributions, does not work well with Debian netinstall.

In this post I explain how to prepare the installation USB for the Debian network installer 10.

Once prepared, we will put the installation medium (CD-ROM o USB) and we will start from it. If we have not configured the BIOS to boot from the media, we can try pressing F12 which generally opens the boot disk choice interface, even so I explain how to prepare the computer in order to boot from our installation medium here.

The installation process is guided and really simple, but you have to take into account some things. If we let it do, it will DELETE the entire disk where we install it, it is better to use a new disk or that we know that it does not contain anything. Partitions can be prepared in advance to save the data we want to save, but that is already for another guide and it is always a delicate process. When you ask us about the graphical environment, it is best to choose a light one such as XFCE4 and Lightgdm, since once the server is started, it will no longer be necessary to use it in situ, that is why we choose a ventilated place so that it is cool and where it does not hinder too much. On the same screen where you ask what graphical environment we will use, we will mark that you install Apache and SSHD, which are the web server and the server that will allow us to remotely access the server.

Remote

Software remoto.

Depending on what system we have as a work computer, we will need some tools or others to access the host by SSH and X11..

– In Linux, it will be enough to have installed a graphical environment and a terminal program with the ability to access ssh as the command line openssh command line., or the Linux version of Putty, that will allow us to have several saved configurations and to test different configurations live to see the texts well and translate keys.

– A Mac, for ssh we can use Putty or Cyberduck, for the remote graphical environment xQartz will allow us to use the X11.

– In windows we have ssh command, but Putty is the most used and comfortable for the ability to save settings. To use the graphical environment we have several options;

Install Cygwin with X11 support, which incidentally will install many compiled Linux utilities for windows in the system. Cygwin is a veteran project that since almost the beginning of PCs allowed to use commands and compile * nix systems programs and communicate with them. But it is too much for this project, also we already have access to a pure linux PC, would be redundant.

Which leaves us with two very comfortable options, Xming y VcXSrv, both almost the same and fully functional.

With a web browser we already complete all the necessary software to configure the server from our computer. there is an option to do this on tablets, but it is not very stable and it spends a lot of resources, at least for now.

In the next post I will explain how to install the operating system that we will use.

Leave a Reply