Linux Server Basics for Beginners. Installing a Linux server.

💖 Do you like it? Share the link with your friends

You do not know how to create a local server on LINUX? Then this article is for you. In it I will clearly explain how to create and configure a local server on LINUX.

IN Lately popularity of free software, including operating systems of the LINUX family, is growing rapidly. Today Linux is not at all what it used to be. To start working with it, all you need to do is basic knowledge about the computer. Most of the programs needed by an inexperienced user are already available out of the box. However, if you are a web developer, or simply creating a website for yourself, you will most likely need a local server. And after looking through some forums, I noticed that users who switched from windows systems in Linux they encounter some problems when creating a server on their computer.

We need our server to support not only static sites, but also most modern CMS, such as WordPress, Joomla, Drupal, etc. For this we will need the following components:

  • apache(webserver);
  • php (the language in which many CMS are written);
  • mysql (database server).

The combination of Apache + PHP + MySQL is quite popular. IN windows environment it is usually called WAMP (I wrote about this in). In Linux, as you already guessed incorrectly, there is a similar name - LAMP (Linux + Apache + PHP + MySQL).

So, first of all, we will install the software package LAMP, for which we enter the following commands in the terminal

sudo apt-get update
sudo apt-get install tasksel
sudo tasksel install lamp-server

With the first command we update information from the repositories, then we install the tasksel command, which is necessary for installing packages, and with the last command we install exactly LAMP package.



As a result of the installation, we will receive all the necessary components for the server, configured to interact correctly with each other.

Setting up an Apache web server

Apache has a lot of settings, which, like most settings of various programs on Linux, are stored in text files. But first, we will make do with just studying a few of them. This is quite enough for us to work comfortably.

The apache web server configuration data is located in the /etc/apache2/ folder.

The mods-available and sites-available folders contain all available modules and sites. And in the mods-enabled and sites-enabled folders only those that are currently enabled. Apache2.conf - main configuration apache file. Ports.conf - list of listening ports.

The server is controlled via the terminal:

sudo /etc/init.d/apache2 start - start the local server

sudo /etc/init.d/apache2 stop - stop the server

sudo /etc/init.d/apache2 restart - restarts apache.

Teams

sudo a2enmod rewrite
sudo a2enmod userdir

we include the rewrite and userdir modules, which allows you to create custom paths for sites.

After any action to enable or disable modules or sites, apache must be restarted to apply the changes.

Now let's start creating platforms for local sites. For example, I will create two local sites. More of them are created in a similar way.

First, create two files with the names of future sites in the /etc/apache2/sites-available/ directory

1
sudo gedit /etc/apache2/sites-available/test1

and write the following lines in it


ServerAlias ​​test1 www.test1
DocumentRoot /home/user/sites/test1

AllowOverride All

2
sudo gedit /etc/apache2/sites-available/test2

and correspondingly


ServerAlias ​​test2 www.test2
DocumentRoot /home/user/sites/test2

AllowOverride All

/home/youruser/sites/test1

/home/youruser/sites/test2 .

In them we create one index.html file. For the first folder - with the text “Page of the first site”, for the second - “Page of the second site”.

In order for the browser to go to the local server when typing the names of our sites test1 and test2 in the address bar, we edit the hosts file

sudo gedit /etc/hosts .

In the first line we add the names of the sites to be created.

You should get the following

127.0.0.1 localhost test1 test2
127.0.1.1 comp

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

comp is the name of your computer, so it will be different.

In the terminal, enter commands to enable sites

sudo a2ensite test1
sudo a2ensite test2

don't forget to restart apache.

All is ready! You can check by typing the names of the newly created sites into your browser.

If something didn’t work out for you or didn’t work out right, ask questions, I’ll try to answer.

Next time I will tell you how to work with databases on local server in LINUX.

This material is devoted to the basics operating system Linux server. From this material you will learn why it is worth using Linux as a server, and also obtain the necessary initial knowledge that will be useful to you to start working with servers based on this OS.

First, let's talk about why you should use Linux as a server operating system. Many people are so used to Windows that they don’t even want to hear about Linux, I mean even custom versions of Linux with beautiful and comfortable desktops. And to the question, why don’t you want to use Linux? Everyone answers: “ Yes, he's kind of clumsy!», « " and so on. But in fact, to all users who are so categorical about Linux, I want to say that Linux is a very friendly operating system, and you just need to understand it a little and everything will become clear to you.

Now I want to list some advantages of Linux over Windows, and also dispel some myths:

  • Linux is a completely free operating system ( with the exception of some paid distributions), unlike Windows;
  • Linux is virtually virus-free;
  • Everyone who says that " Programs I use on Windows do not install on Linux", You might think, why should they be installed!!! After all, this is a completely different OS, it has its own programs! It can also be said about Windows that “ programs that run on Linux do not install on Windows“, for Linux there are many of their own programs that are not inferior to Windows, and many software manufacturers also release their products for both Windows and Linux.
  • Linux is more productive, especially the server version of the operating system. I explain, server operating systems Linux systems without interfaces, but most of the resources ( more than a half!!!) just occupies the OS interface, i.e. visual shell ( today have become widespread and Windows versions no GUI).
  • Linux OS practically does not freeze, ( I mean the operating system itself). For example, everyone has encountered a situation where in Windows everything freezes, you can’t help but move the mouse, you can’t even press ctrl+alt+del, and you have to reboot. Linux is designed in such a way that such a situation is excluded, except in one case when you yourself cause such a situation.
  • Regarding the Linux server OS, it is quite simple to configure, unlike its Windows counterparts, which have a lot of different gadgets that are not so easy to understand. The Linux system itself and all its services are configured by editing configuration files. These are ordinary text files, knowing their location and format, you can configure any distribution, even if you don’t have any tools at hand other than a text editor.

I don't want to popularize the Linux OS and somehow disparage Windows, but in some cases there is no better option than using the Linux operating system. Until some time, I also thought that Linux was somehow not our thing, but when I came across this OS, I was simply pleasantly surprised.

Now let's get straight to the basics Linux Server. For example, we will use the distribution Linux Ubuntu Server 10.10.

Basic Linux Server Settings

Describe the process Ubuntu installations Server 10.10. I won’t, because it’s no more complicated, and maybe even simpler than Windows installation, the only thing I ask you to do during the installation process is when “ Selecting the software to install» mark installation « OpenSSH Server" This is so that you can later connect to this computer remotely using an ssh client ( for example PuTTY). And at the same time, you will have full access to the operating system from any computer on your network, since a monitor is usually not attached to the server and the server itself is located in a specially designated room for servers ( server).

In the window " Setting up user accounts and passwords» Enter your username and set a password.

After installation, you boot for the first time, and the OS management console appears before your eyes. To begin, enter your login, press enter, and then your password in order to enter the OS itself. You will be logged in as the user you just created, which does not have root privileges.

Setting up users in Linux

ROOT– standard superuser of Linux OS, which has maximum rights. By the way, unlike Windows, in which administrator rights are not the highest ( there are also system ones), and here root rights the highest and if you work as root and perform any actions, no one will ask you “ Do you really want to do this?"as in Windows, for example, but let's say right away that you will kill the system, without any questions there. But, one way or another, we first need to activate this user, because in the future we will need superuser rights ( Tip: Always work under regular user until you need to switch to root mode), root is disabled by default. Activation account root is done as follows, just set the password for root.

Sudo passwd root

The system will ask you to enter the password of the user you are working under, and only then will you enter a new password for the future root and repeat it.

Since we're talking about users, let's learn how to create them. It's done like this.

Sudo useradd -d /home/testuser -m testuser

  • sudo is a utility that grants the user some administrative privileges;
  • useradd – a utility that adds a user to the system;
  • -d – option to set the home directory for the user;
  • /home/testuser – home directory path;
  • -m – option to create a home directory;
  • testuser is the name of our new user.

Now we set a password for the new user.

Sudo passwd tester

Setting up a network in Linux

Now that we have a little understanding of the users, we need to configure the network, it is quite possible that the DHCP server has already done this, but perhaps you want to set static IP addresses, gateway addresses and DNS ( which, in principle, is natural for the server).

To do this, edit the following file.

Sudo nano /etc/network/interfaces

  • nano is a standard Linux editor;
  • interfaces – a file responsible for the network configuration.

When you open this file, you will see something like the following, or rather, it will look like this in the end if you need static IP addressing on this computer.

# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.1.2 netmask 255.255.255.0 gateway 192.168.1.1

Here eth0- it's yours network connection, there can be many of them depending on how many you have network cards, Static says that this is a static IP address; if it were dynamic, then DHCP would be specified instead of static. Well, the rest is probably all clear.

  • Address – computer IP address;
  • Netmask – subnet mask;
  • Gateway - default gateway.

Save the file by pressing ctrl+o and then exit the editor with ctrl+x.

Now you need to assign a DNS server, this is done by editing the following file.

Sudo nano /etc/resolv.conf

Write or change the following.

Nameserver 192.168.1.100 nameserver 192.168.1.200

Where, 192.168.1.100 and 192.168.1.200 are the addresses of our DNS servers, if you only have one dns server, then specify only one line.

When we have configured everything, we need to restart our network interfaces, this is done as follows.

Sudo /etc/init.d/networking restart

Installing programs on Linux Server

IN Linux programs are installed completely differently than in Windows, so the knowledge that you had when working with Windows will not help you here. In Linux, all software is stored in Repositories - this is a kind of repository of software packages special for Linux, which is located on the Internet, and is freely distributed online, or on CDs. In order to update your repositories ( already installed on Linux OS), You need to run the following command ( provided that you have an Internet connection).

Sudo apt-get update

Now that we have updated the standard repositories, you can install something, I suggest installing a file manager, one of the most common in Linux is - Midnight Commander(MC). There are slight similarities with FAR, which is used in Windows. Programs on server Linux are installed as follows.

Sudo apt-get install mc

Where, mc is our program that we want to install, i.e. our file manager Midnight Commander.

After installation you can try this program, it is launched simply, enter the name of the program in the console, i.e. mc and press enter.

I think this is enough for the basis; in the following articles (Basic Linux Ubuntu Server Terminal Commands) we will talk more specifically about setting up any services ( demons). And that's all for now.

The Linux operating system is most often used for servers. Linux was designed from the ground up for this, it has a secure architecture and is also freely licensed, which can save you a lot of money.

But there is a huge amount Linux distributions and you need to choose which one is best suited for your project. Each Linux distribution has its own characteristics and advantages, as well as disadvantages. In this article, we will look at the best Linux distributions for server.

You may already know some of them, but you will hear about others for the first time. The review took into account features such as ease of installation and use, price, availability of commercial support, reliability, and so on. Now let's move on to the list of the 10 best Linux distributions for the server.

First on our list is Ubuntu. This is a very popular Linux distribution based on Debian and developed by Canonical. In addition to the desktop version, there is a server version.


Ubuntu has a straightforward installer, is easy to use and configure, and has world-class commercial support from Canonical.

The latest release of Ubuntu 16.04, which took place in April 2016, has become even better. Now it supports OpenStack Mitaka support, and LXD container virtualization, as well as the unified Snappy package delivery system. In addition to servers, Ubuntu is designed to work with new technologies such as containers, mobile devices and Internet of Things (IoT) devices.

Nowadays, Ubuntu is most often used to run web servers among all other distributions. The latest release of Ubuntu is marked LTS, which means long term support. This operating system will receive updates for five years.

2. Red Hat Enterprise Linux

Story Red Hat started as a small company to create a commercial distribution. Now it is a powerful server operating system that plays a significant role in the development of open source software, even more so than Canonical.


Developers from Red Hat are actively involved in the development of open source software, they even have their own infrastructure for creating web applications based on Red Hat Linux - OpenShift.

The Red Hat Linux distribution is used by large companies around the world, contains the latest, but already quite proven technologies, and provides support and updates for versions of its distributions for ten years.

Red Hat Entrprice Linux is based on the Fedora distribution, developed by the community and sponsored by Red Hat. Fedora is updated more frequently than RHEL and serves as a testing ground for new features and technologies that will later be included in Red Hat. But there is no such stability and commercial support as in Red Hat.

At the moment, the latest version of Red Hat Enterprice Linux 7, which has been developed since 2010 and was released in June 2014. The main improvements are scalability for enterprises, new file system, which can scale up to 500 terabytes, as well as support for Docker virtualization technology. The last corrective release of Red Hat Enterprse Linux 7.2 took place in November 2015.

3. SUSE Linux Enterprise Server


SUSE Linux Enterprise Server (SLES) is developed by Novell. It is a stable, fast and easy-to-use Linux distribution, with fast 24/7 technical support.

Just as Red Hat Enterprise is based on Fedora, SUSE Linux is based on the free OpenSUSE distribution. The developers focus on stability, technical support over time, and distribution support for the latest technologies. If you have enough money to pay for support, this is best linux for the server.

The last major release of SUSE Linux Enterprise 12 (SLES 12) was released at the end of October 2014. Interesting features have appeared here, such as support for the Docker framework, a full-fledged version rollback system, hot kernel updates on the fly, as well as other software modules to improve the smooth operation and efficiency of the system. SLES 12 SP1, which was released in December 2015, added support for network configuration and JeOS.

4. CentOS


If you have a website hosted on any web hosting service, there are many chances that your web server is running on CentOS. It is a free system based on Red Hat Enterprise Linux, and it is not a completely commercial system, but you can count on commercial support.

Community Enterprise Operating System or CentOS is developed and maintained by the community. The code is based on Red Hat, but all trademarks of this system have been removed. We can say that this is the best Linux for a server.

In 2014, there were statements that CentOS would work with Red Hat to reduce the gap between the innovation-oriented Fedora distribution and the commercial CentOS distribution.

But CentOS will continue to provide the system for free to users. At the same time, this system remains supported by the community, and not by Red Hat. Last CentOS version 7.2 was released in December 2015 and is based on Red Hat Enterprise Linux 7.2.

5. Debian

Debian is a free operating system and there is no commercial support. But you can take advantage of the support of Debian Certified Centers around the world. The Debian project originated in 1993 and now a large number of distributions are based on it, the most famous of which are Ubuntu and Linux Mint.


Debian remains an excellent option for those who value stability in exchange for the latest technology. The last major stable release was Debian 8 Jessie, released in April 2015, which will continue to receive updates for five years.

In this Debian versions switched to new system Systemd initialization, instead of the old SysV init, the kernel and software were also updated - Apache, LibreOffice, Perl, Python, Xen Hypervisor, GNU Compiler Collection, GNOME desktop environment and Xfce. Last update Debian was in July 2016, version 8.5.

6. Oracle Linux

If you didn't know, Oracle releases its own Linux distribution, Oracle Linux. It is based on Red Hat and contains various improvements from Oracle.


Oracle Linux is a fairly strong competitor to Red Hat Enterprise Linux, since Oracle support is half the price of Red Hat support.

The distribution is optimized primarily for databases, so if you need databases, it is better to use this distribution.

The latest version of Oracle Linux 7.2 was released in November 2015 and is based on Red Hat Enterprise 7.2.

7.Mageia/Mandriva

Mageia is a fork with open source code Mandriva Linux project, which was closed in 2011. Mageia 5 was released in 2015, and Mageia 6 is expected to be released in August-September 2016.


This distribution was developed in France and is popular in Europe and South America. The name Mandriva and the code base itself are taken from the Mandrake and Connectiva Linux distributions.

Mageia retains the strengths of Mandriva and continues to evolve with new features and capabilities. Mageia updates are released every 9 months and each release is supported for two cycles, 18 months.

8. ClearOS

ClearOS is an open source distribution based on Red Hat Enterprise Linux and CentOS, developed by Intel. It can be used as a server, a network gateway, or an application platform.


Formerly known as ClarkConnect, ClearOS has become a great option for implementing a Linux server for small businesses. There is an excellent web interface for managing the system, as well as a lot of documentation. Therefore, this distribution will be an excellent option for beginners.

In addition to the commercial version, there is ClearOS Community Edition, as well as an inexpensive professional version, which includes technical support and a range of additional functions. The distribution is supported by the Clear Foundation, and there is also a store of applications, both paid and free, that can be used to expand the capabilities of the OS.

The latest major release of ClearOS became available for download in March 2015. The latest update to ClearOS 7.2 received home and business editions, improved virtualization support (including Microsoft HyperV), XFS and Btrfs support, a new dynamic dashboard, LVM caching support and IPv6 support .

9. Arch Linux

A simple, lightweight Arch Linux distribution designed for the more experienced Linux users. There is no support and installation is not at all easy, unlike what other top linux server distros offer. But this does not mean that Arch Linux cannot be used as a server.


Like Gentoo, it uses a rolling release model, which means that the system will always be updated to the latest new version, no releases.

The Pacman package manager ensures software updates to latest versions, with dependency resolution. True, this method of updating can sometimes cause problems if not handled carefully.

10. Slackware

Although Slackware is not a commercial distribution, the developers maintain relationships with several companies that provide paid support.


This is one of the earliest Linux distributions. It was released in 1993 and has a lot of fans. Developers regularly release new versions; the latest Slackware 14.2 was released in July 2016.

conclusions

Our review has come to an end, now you know which Linux distribution to choose for the server..04. It's possible that not all of the best distributions are listed here. Which linux better server In your? Which one do you use? Write in the comments?

Peculiarities:

  • The distribution is based on RedHat Enterprise Linux
  • Stable
  • Reliability
  • Lack of official support

The strengths of the CentOS distribution are its reliability and compatibility with Red Hat Enterprise Linux. Weak sides– poor localization (compared to ALT Linux and ASPLinux), lack of some programs typical for our region (SIM, xxkb). It is not possible to obtain support from the manufacturer in our region; There is no non-commercial support in Russian and Ukrainian. The system works great on clusters.

Fedora

Peculiarities:

  • Widespread
  • Excellent community support
  • Good protection
  • Many different applications
  • Russification is not fully present
  • Constant updates

More suitable for a PC than a server due to possible instability. But it all depends on the ability to use the distribution correctly.

openSUSE

Founded by the German company of the same name, which was later acquired by Novell. A distinctive feature is the presence of its own YaST2 software package, which allows you to install and configure any system components.

Peculiarities:

  • Professional approach to detail
  • Easy-to-use YaST configuration utilities
  • Russification suffers (part of the menu may be in English, part in Russian)
  • Easy equipment setup.
  • Excellent documentation in Russian
  • There is a set of drivers out of the box
  • Large selection of packages through the use of RPM and plug-in repositories.
  • OBS build system

ALTLinux

Russian distribution developed by ALTLinux. It grew out of Linux-Mandrake Russian Edition. Much attention is paid to safety.

Advantages:

  • Russification of documentation and applications.
  • Simple graphical installer(in most cases it does not require dancing with a tambourine).
  • A large number of graphical system configuration utilities.
  • Stability and reliability (best suited for servers).

Peculiarities:

  • Excellent Russification
  • Technical support
  • Wide selection of software
  • Produced by a Russian company

ASPLinux

Russian-language distribution, created based on packages from Fedora Core, but with security fixes. Includes quite a few "additional" (compared to Fedora Core) packages. The kit includes binary drivers (ati, nvidia, slmodem), video codecs and some other not entirely open programs.

For now, work on this distribution has been suspended.

Distributions based on Debian or using the Deb package format:

Debian

An operating system consisting of both free open source software and proprietary components. In its primary form, Debian GNU/Linux - one of the most popular distributions Linux, which has a significant impact on the development of this type of OS as a whole. There are also projects based on other kernels: Debian GNU/Hurd, Debian GNU/kNetBSD and Debian GNU/kFreeBSD. Debian can be used as an operating system for servers and workstations.

Peculiarities:

  • 100% free
  • Excellent website and community resources
  • Well tested
  • Excellent Aptitude software installer.

Ubuntu/Kubuntu/Xubuntu

Built on the basis of the test tree of Debian GNU/Linux packages, and is essentially a Debian assembly containing the latest software for home or office use. The fastest and most actively developed distribution.

Peculiarities:

  • Simple, intuitive multilingual interface
  • Frequent and easy updates online and offline Package repository
  • Powerful community of users and developers, incl. in Russia

Distributions using other package systems:

Gentoo

Gentoo is a typical representative of source-based distributions, that is. All software is presented in the form of source codes for installation. This distribution is most likely not suitable for a novice user, but recently it has gained quite wide popularity.

The following advantages of Gentoo Linux can be highlighted:

  • Possibility of fine-tuning and optimization for a specific computer, since all packages are assembled (compiled) on the end user’s machine.
  • A convenient system for installing and uninstalling programs, based on the “ports” system. Connecting remote repositories.
  • New versions of packages appear in repositories with high speed(a few weeks, or even hours after their official release)
  • Ability to install Gentoo from working system without interruption from work.

Flaws:

  • Russification (locale, fonts, etc.) will have to be carried out manually, by running scripts.
  • Documentation in English
  • If problems arise with software installation, the solution may not be trivial and may require technical knowledge.

Peculiarities:

  • Painless installation of individual packages
  • High relevance
  • Excellent documentation
  • Creation of a distribution kit in “geek style”, specially adapted to the needs of the user
  • Graphic installer
  • Long and tedious system installation

Gentoo Linux is a very flexible distribution. Allows you to work with almost any equipment configuration and make the system as workstation, and the server. Of course, creating a personal configuration requires some skills and understanding of the operating principles of the Unix family of operating systems.

Calculate Linux

Calculate Linux- a family of distributions designed for small and medium-sized businesses that use roaming profiles and centralized software deployment. Created based on the Gentoo Linux project and fully compatible with it.
Peculiarities:

  • Ready-made client-server solution.
  • Rapid enterprise deployment.
  • Complete work in heterogeneous networks.
  • Rolling-release update model.
  • Includes specially designed Calculate utilities for system configuration, assembly and installation.
  • Interactive system assembly is supported - preparing an ISO image of the system for your tasks.
  • Ease of administration.
  • Possibility of installation on USB-Flash or USB-HDD with ext4, ext3, ext2, reiserfs, btrfs, xfs, jfs, nilfs2 or fat32.
  • 100% Gentoo compatible with support for binary update repositories.

To create a terminal, file (FTP) or mail server on Linux, you need to be able to work in this operating system. Otherwise it will be difficult to figure it out. No OS needed powerful computer. Because it does not waste extra resources on graphic design. Linux distributions can be deployed even on an old PC. Therefore, Linux or Ubuntu Server is often used to create various servers.

A lot of different literature has been written about this. Some books about Linux are a thousand pages long. You will have to work through the terminal and enter all commands manually. But you can still make a small Linux server with your own hands, which will include file storage, Web services and a mail protocol.

Ubuntu Server is based on the Linux operating system. Not needed for it to work modern processor, good video card or large volume random access memory. With Linux, you can deploy a server even on an old laptop. And it will have all the necessary components: mail, FTP, Web.

You can download a Linux disk image from the Ubuntu.ru website. Choose any version with Server (not Desktop!). The download will take place through a Torrent client. This image must be written to a disc or flash drive (using LiveUSB). You can also use a virtual drive.

Ubuntu has a simplified interface. There are no graphic excesses in it. This OS is perfect for making a DIY Linux server. With it, computer resources will be used for the needs of the domain. After all, she needs very little to work.

Its installation goes like this:

  • Select the language and region you live in.
  • Create an administrator name. It is used to manage the server.
  • Also enter a username in the “Username for your account” field. Under this account you will communicate with Ubuntu technical support.


Specifying the username in Ubuntu

  • Enter password. Confirm it.


Enter your account password

  • Specify the domain if you have one. It will contain all services: file (FTP), email, website hosting, and so on.
  • Wait while the system installs.
  • After that, she will offer additional components.

Here is a list of what is needed for a Linux server and its full operation:

  • Open SSh. Is used for remote administration. This will come in handy if you decide to manage the service from another computer. Then on a Linux PC you can disable the monitor and video adapter.
  • LAMP. A set of Linux utilities that includes Apache (Web server). MySQL (database) and PHP (programming language for CMS). These components are needed to create a control interface.
  • Samba file server. Allows you to configure file sharing between computers. If you need an FTP server, select this option.
  • Virtual Machine host. Install if you are going to use virtualization capabilities.
  • Print server. Network printers.
  • DNS server. Domain Name System. With it you can recognize the IP address by the computer name and vice versa.
  • Mail server. Mail server.
  • PostgreSQL database. Object-relational databases.

Select what you need and confirm installation. When you first start, you will need to enter your administrator login and password. The console will open. It is similar to the Windows command line or the MS DOS operating system interface.


Initially, you will need to check for updates. Type the command “Sudo apt-get update” or “Sudo apt-get upgrade” without the quotes. After the update, you can start setting up all server components: FTP, mail, Web.

There is a pseudo-graphical interface for Ubuntu - Midnight Commander. This is an analogue of the Norton Commander shell, which was developed for the MS DOS system. It’s easier to work with such an interface - everything is clearer than in the console.

Launching the Linux Terminal

Modern Linux uses a terminal instead of a console. To enter it:

  1. Open Applications.
  2. Click "Standards".
  3. There will be a "Terminal" there.


You can enter commands into it just like in Ubuntu Server.

  • To install LAMP components (if they do not already exist), you need to sequentially enter the commands “sudo apt-get update”, “sudo apt-get install tasksel” and “sudo tasksel install lamp-server”. After each one, press Enter.
  • To download Open SSh, type "sudo apt-get install openssh-server".
  • To install Samba file server, write “sudo apt-get install samba”.

When installing MySQL from the LAMP package, you will need to set an administrator password for SQL.

Local Web server

For Web creation the server must have its own dedicated IP. Then after installing LAMP at this IP address it will be available test page Apache. This is the future Web. In the future, it will be possible to install FTP, databases, and a mail protocol on it. To configure the Web server:

  • Install phpMyAdmin. To do this, in the terminal or in the console, type one after another, enter “sudo apt-get install phpmyadmin”


  • And then “sudo service apache2 restart”.
  • The component will load. Apache will be restarted. Further actions depend on the operating system version.

If you have Ubuntu 13.1 and above, use the commands:

  1. sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
  2. sudo a2enconf phpmyadmin
  3. sudo /etc/init.d/apache2 reload

Enter them sequentially one after another, after each press Enter.

On Ubuntu 16.04, other instructions are needed:

  1. sudo apt-get install php-mbstring php-gettext
  2. sudo phpenmod mcrypt
  3. sudo phpenmod mbstring
  4. sudo systemctl restart apache2

After entering them and automatically restarting the service, the web interface will be available at http:///phpmyadmin.

  • The configuration and data about it are located in the Apache server folder “etc/apache2/”. Apache2.conf - configuration file for the distribution
  • The “mods-available”/“sites-available” and “mods-enabled”/“sites-enabled” directories contain mods and sites.
  • Ports.conf lists the listening ports.
  • If you add the word "Stop" after the command "sudo /etc/init.d/apache2", Apache will pause. If “Start” it will start again. If “Restart” - it will reboot.
  • To independently choose the path for saving sites, sequentially enter “sudo a2enmod rewrite” and “sudo a2enmod userdir” into the terminal.

Each time after making any changes, you must restart the service with the “Restart” command.

Mail server

To create a mail server on Linux, you must already have a domain registered. You also need to have a static IP.

  • Install the Postfix component. To do this, type “sudo apt-get postfix” in the console.
  • When it boots, write the command “sudo /etc/initd/postfix start”. The service will start working.
  • Postfix already contains the parameters that are needed to fully work with the SMTP protocol. But still, a little tweaking wouldn't hurt.
  • Open the /etc/postfix/main.cf file.
  • Find the value “mydomain =” in it. After the “=” sign, write the domain name.
  • Then look for “myhostname =”. And enter the machine name.
  • Now the mail server can send letters to other computers that are on the same network. So that it can send correspondence to other domains on the Internet, in the “main.cf” file, find the line “inet_interfaces =”. Place the word “all” after it.
  • In the “mynetworks =” variable, enter the range of addresses of all computers on your subnet (for example, 127.0.0.0/8).

If the service is configured correctly and all conditions are met (permanent IP address, registered domain), then the Server will be able to receive and send correspondence. If your domain's MX record refers to your host.

To view resource logs, use the command “tail -f /var/log/mail/info”. To receive a message from him, enter "mailq".

File server

You may need a Linux FTP server to exchange documents and upload files. There are several versions of such resources: vsFTPd, Samba, proFTPd.

Let's take a closer look at vsFTPd. It can be installed and launched with one command - “sudo apt-get install vsftpd”. Further settings depend on your preferences and what kind of service you want to make. Administrator rights may be required to change settings.

  1. Immediately after downloading the program, the system creates a new user and adds a folder to the home directory that is intended for working with server storage. Also in the “etc” directory there is a file “ftpusers”. There you can add users who are denied access to files.
  2. After installation, it is better to change the directory in which the files should be located to the “var” folder. To do this, as an administrator, write the command “usermod -d /var/ftp ftp && rmdir /home/ftp”.
  3. Create new group users. For example, "userftp". Type “addgroup userftp” into the console.
  4. Add a new account to it (for simplicity, we will name the user and group the same). Use the command "useradd -a /var/ftp -g userftp userftp". It also creates a user. To include an existing nickname in the group, instead of “useradd” write “usermod”.
  5. You need to come up with a password for the new user. Enter “passwd userftp” in the terminal.
  6. Type "chmod 555 /var/ftp && chown root:userftp /var/ftp" to give the account access to the file server root folder.
  7. Now create a public directory. Sequentially enter “mkdir /var/ftp/pub” and “chown userftp:userftp /var/ftp/pub”.

Initially, FTP starts in offline mode. She has a script that plays the role of a demon. With this functionality, several commands are available. They are entered after the line “sudo service vsftpd”.

  • Stop and Start. Disable and enable.
  • Restart and Reload. Restart. Needed to apply new settings. The difference between the commands is that in the second the reboot occurs without a complete shutdown.
  • Status. Status information.

Further configuration of the server involves rewriting the configuration file, which is located in etc/vsftpd.conf. It has a simple and understandable structure. It's quite easy to understand. Although this requires certain knowledge. Before changing this file it makes sense to do it backup copy. So that if errors are detected, everything can be restored. Enter the command “cp /etc/vsftpd.conf /etc/vsftpd_old.conf” and the information will be saved.

After this you can start editing.

  • In the “listen=” parameter write “YES”. Then the server will work in independent mode.
  • "Local_enable" allows local users to log in.
  • "Write_enable" gives them access to their home directories.
  • "Anonymous_enable". You can limit rights anonymous users, if you put “NO”. There is also an option “no_anon_password” - anonymous logins without a password. It can also be banned.

If you want to make a public server, then after the “listen” line you need to add several additional parameters.

  • "Max_clients". Number of simultaneous connections.
  • "Idle_session_timeout" and "data_connection_timeout". Session timeouts.
  • "Ftpd_banner". Welcome message for visitors. You can write, for example, “Hello!”

Terminal server

A Linux terminal server is intended for enterprises and offices, where all computers are connected into one network. It is very convenient when you can access the terminal from any PC (if it has access) of the organization. This opens up great opportunities for remote administration.

LTSP - Linux Terminal Server Project - is suitable for this task. The program is included in the standard Ubuntu package. To install it:

  1. Enter the command "ltsp-server-standalone".
  2. Then write “apt-get update && apt-get install ltsp-server-standalone”.
  3. Wait for everything to download and update.
  4. Now we need to install the client system. Type "ltsp-build-client".
  5. Then "ltsp-build-client -dist trusty -arch i386 -fat-client-desktop lubuntu-desktop".
  6. Use the "debootstrap" command and the distribution will automatically expand to the "opt/ltsp/i386" directory.

Linux Server can run even on weak PCs. Therefore, it is very often used to create servers and remote administration. Mail services, FTP storages, and terminals are made on this operating system.



tell friends