What server to make on Linux. Installing programs on Linux Server.

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

So, the network is up and the switch is vigorously blinking its diodes. It's time to set up our small but proud server running Ubuntu Server 10.04 LTS. Using a disk image (it can be via HTTP or via torrent, - 700Mb.) we write it to a disc. For these purposes, I recommend using " Daemon Tools Lite" or "" since both of these programs are free and fully meet our requirements.

An option suitable for those who do not want to configure the installation and want to quickly experiment with the project; A web installer suitable for those with a web hosting platform. This script allows you to start the wizard setup process; To do this, upload the file to the server and access it through your browser. The next section will detail the installation steps. Many of them are available to the most popular versions operating system. . First we install the web environment.

The figure shows a screen that prompts the administrator to set basic parameters. As many readers know, a modern website in most cases consists of a customized web application. A web application is software written to run on a server machine whose user interface is based on web technologies.

We exhibit in bios boot from CD or DVD and reboot.

To begin with, we will be asked to select the installation language. Let's choose Russian.

Clue: Pay attention to the line at the very bottom of the screen. It lists the function keys that you use to navigate menus, select options, access help, and so on. This is a feature of nix systems.

The evolution of the technologies on which modern web applications are based has been gradual. As some will recall, in the early days of the Internet, websites were static pages stored on the server's file system and transferred to the browser via . This functionality is implemented via a web server.

Later, websites become increasingly dynamic: page content is no longer static. It is actually created by outputting the corresponding scripts executed by the web server. This paradigm led to the creation of specific programming languages ​​for this purpose, such as.

We find ourselves in the disk boot menu. Select “Install Ubuntu Server”.




We will be asked where we will use our server, this will affect the choice of update mirrors (repositories). Since Internet providers usually provide access to IX (UA-IX, MSK-IX and similar segments) for more high speeds, choose our location. Since I live in Ukraine, I chose “Ukraine”.

The evolution of web scripting languages, introducing the ability to interact with databases, finally confirmed the birth of web applications as we know them today. There are several software components on which the web application is based. They implement all the functions necessary for the operation of any web service. All these functions can be implemented in generic components, so avoid reinventing the wheel every time. The collection of these components is called a stack.




The first is about how to manage the machine's resources to allow programs to run properly. This paradigm allowed developers to focus only on application and also led to some uniformity in their development.


Password authentication protects the data inside it from unauthorized access. The password specified at this step will provide full access to the server.







In the list of countries, select “Russia”:




After this the search will begin network devices For additional features installations.




Your browser should display a page similar to the one shown in the image below.


After authenticating with the user's password, the packages should be downloaded and installed without errors. If you make this change, be sure to restore the original value after fixing the problem to prevent creating very large file magazine.

Here are some examples of settings that you may need to change right away. After authenticating with the user's password, the packages need to be downloaded and installed. If you make any further changes, be sure to restore the original values ​​after fixing the problem to avoid large files large size magazine.

So, after a thorough search, two were found (in the Linux environment they are designated as eth0 and eth1 - ethernet). We need to select the one that is connected to the Internet (router or modem in our local network).




If DHCP was configured on the router ( DynamicHostConfigurationProtocol- automatic assignment protocolIPaddresses), the network card will receive the appropriate settings automatically. In my case, the DHCP server was not configured, which the installation program informed us about. It doesn’t matter, because you can configure everything manually later, accept the failure and continue with the installation.

Web servers are used to "serve" web pages for "request" clients. You can configure the port number, document source, forms, log files, virtual hosts, and more. For example, if a virtual host is added, the changed settings of the virtual host take precedence over the hosts.

Virtual Host Settings

For an undefined directive, the default value is used. Matches the name-based virtual host directive. The recommendations for a virtual host only apply to that specific host. If the directive is configured internally on the server and is not defined in the virtual host settings, the default settings are used. For example, you can configure the address Email for the webmaster and do not define any for virtual hosts.




So we were offered to enter the connection settings manually or try again, skip the network setup or go back and select another network card. Select “configure the network manually”.




  • IP: 172.30.2.3
  • Netmask: 255.255.255.0
  • Gateway: 172.30.2.1
  • DNS: 172.30.2.1

After setting up, we will be asked what our new server will be called? I called him " CoolServ" The name should contain only Latin letters, numbers, dashes or underscores, otherwise unforeseen troubles may arise.

This section covers setting up a basic server. It must be stored on local disk. In most cases this can be left unchanged. User. The user directive sets the user ID that the server uses to respond to requests. This parameter determines access to the server. Any file that is inaccessible to this user is also inaccessible to anyone who visits the site.

A group directive is similar to a user directive. Group specifies the group to which the server should respond. This means that only basic features are included on the server. By loading certain modules, additional functionality can be added. Some modules are enabled on the server during the compilation phase. You may need to include recommendations for a specific module, to do this you need to include them in a type block. To set up a secure server, use public key encryption to create a public key and a private key.

In general, it is better to follow three rules for naming variables in programming languages, namely: the name should not begin with a number, there should be no spaces in the name, and you cannot use reserved words (special constructs, for example if, else, for, goto, etc.) There is also a fourth thing - do not use characters from national alphabets other than Latin, for example: Russian, Japanese, Ukrainian, etc. If you adhere to this rule, you will never have problems with the operation of programs and the display of file names.

In most cases, a Certified Claim is sent confirming the Company's identity and payment to the Certification Authority. Or you can create your own self-signed certificates. Certified self-signatures should not be used on a commercial basis. Self-signed certificates are not automatically accepted by browsers. Users are prompted to accept the certificate to establish a secure connection.

Browsers automatically recognize the certificate and activate a secure connection without requiring anything from the user. A self-signed certificate is not recognized by web browsers and at the same time does not provide any guarantees about the organization that operates the website.




The OS has determined that we are in the Europe/Zaporozhye time zone, those are GMT+2, everything is so. Accordingly, you will have your own time zone if you do not live in Ukraine.




Now comes the worst part of any OS installation - the markup for its installation. But friendly The OS (this is how the word “ubuntu” is translated from the language of some banana republic tribe) will help us do everything quickly and efficiently. We have two marking options: automatic or manual. Since we are not looking for easy ways, we choose manual marking.

  • Create a public and private key pair.
  • Create a public key certificate request.
  • The certificate request contains information about the server of the company that hosts it.
  • You cannot recommend which certification body to choose.
  • Install a certificate on the server to use secure connections.
To generate a key from the terminal, enter.

Now you must enter the passphrase. For added security, it must contain at least 8 characters. Remember that the key phrase is "case sensitive". Repeat the passphrase to verify. A passphrase is required. After installing the certificate, you must restart the web server. To do this, enter from the terminal.




The photo below shows the connected drives. In our case, this is one 8 GB SDA disk under the name (WD, Seagate, etc. In my case this is - virtual disk Virtual Box). Let's choose it.

Note: In *NIX-like OSes, drives do not have the usual Windows names, such as “C” or “D”. Instead, they are referred to as HDA (for an IDE channel) or SDA (in the case of SATA or SCSI drives).

After correct input, the secure web server starts. Of course, the reasons that can lead us to such a decision are not limited to this aspect, but are diverse. The first thing to do is to create a folder that will contain files that users can access.

My advice is to completely erase the contents so you have a clean view of the configuration options, which will end up being just over twenty for so many lines! This guide ignores security aspects fundamental to a web project. Therefore, it may not be enough to follow these steps to create a suitable environment for publishing open web applications.

The last letter in the name (A) indicates the disc in alphabetical order. Those. - the next SATA drive will be called SDB, SDC, and so on. But this is only the naming of physical disks, and their logical partitions will look like SDA1, SDA2, SDA5, etc. Moreover, numbers from 1 to 4 mean the primary partition, from 5 and above - logical. Don’t be confused by such a strange name; over time, I hope, it will become as easy and familiar as in the MS Windows environment.

Let's start with some preliminary actions. We create test file in the default folder. Inside the file we include the line. Let's continue by changing the default site configuration by typing. The default file should be as follows. Finally, we can set up the new site. It's useful to create a separate configuration file for each site so you can enable or disable it without affecting other sites.

Thus, the cost of dedicated dedicated hosting is around 80 euros per year, which is very profitable. Sessions every month, 30 thousand users, views on 125 thousand pages and a maximum of 400 users simultaneously on the Internet. The reason for its popularity is that it is free and very stable. This can save traffic and charging time. This is done without recompiling the web server. This is done by setting up virtual hosts. This can be done using the following command. This can happen either from your distribution's binary packages or from source code.




The ominous inscription in the screenshot below informs us that everything that was on the disk may be lost during re-partitioning, but we are not afraid of anything and click “Yes”.




After this, a partition table will be created, which needs to be “filled” with the partitions themselves. Select an empty space and click next (Spacebar).

In most cases, the package is compiled with most of the useful options, and compiling from source is pointless. After downloading the code, you need to extract it. There are many useful options in this script that you can see. Here is an example configuration.

Note 2: If there is no patch for your kernel version, you can download the patch with the version closest to you and link as follows. Install the patch on the kernel. Exit the configuration menu and save the configuration. Compile the new kernel and modules. Reboot your system and make sure the new kernel is working.




In the next screenshot, select “Create a new partition”, although everything can still be done automatically, we will stubbornly set it up manually :)




We enter the size of the new disk in MB or GB, first we will create a swap (analogous to a paging file in MS Windows), 512 megabytes in size. Although it is recommended to make a swap size one and a half times larger than the size of the total amount installed, we will make it equal to this value.

This is what includes the kernel part in the installation. In this example we will use one server address. The second line specifies the range of addresses that will be assigned to clients. We continue setting up the server. You can limit encryption to 40 bits. Now we will add user accounts.

An actual user record can appear in several ways. Please note that passwords containing Special symbols, must be enclosed in quotation marks. For the client part we have the same requirements as for the server. In chapter. We place following lines to this file.

Note: *NIX operating systems (Unix and Linux) use the page file more correctly (especially in versions without GUI), here the swap will be loaded extremely rarely. For example, on my server, out of a 1Gb swap, a few megabytes were used as much as possible, and that was due to a really heavy load and uptime for about a month. In any case, there is no point in doing more than a gigabyte, as you will simply lose space, which is always missing.

There is one last detail that we need to take care of and that is routing. When we're done with this, we'll save the file and make it executable. Now everything is ready and we can release the tunnel. First edition with examples. The material in the book is distributed in three parts. The first chapter, Network Basics, discusses the basic networking terms used to work with web servers. Here are the basic concepts related to web servers in general and the process of retrieving information on the Internet. He shows comparative characteristics usage of web servers in terms of their number and market share. The first part ends with the processing features of server applications. The first chapter of this section introduces the server's capabilities and architecture. Detailed steps and features of installation from the installation package and compilation of programming code are described. The main files were reviewed configuration files and a directory-level configuration file. Descriptive usage of each directive is given. Examples are included for linking databases using these languages. Finally, server configuration and administration are discussed.

  • The first part, “Web Servers,” is divided into two chapters.
  • Chapter 2, Web Servers, provides an overview of Web servers.
  • A review of popular web servers was conducted.
The system administrator is responsible for installing, maintaining and updating operating systems, software and computer networks necessary to run a business.




Select the partition type. I chose primary (i.e., the full name of this partition will be SDA1)




In the next screenshot we will need to explicitly indicate that this will be a swap section. To do this, in the partition settings, select the “swap partition” option, check the “boot” label and finish setting up the partition.




Now again we select a free area, create a disk, but now we will select the “logical” type. Let's set the size to 15 GB, file system type: EXT4, mount point: / (root) and that's it for this section.




For the remaining space, we create a logical partition with file system EXT4 and mount point /home, this will be the home directory of all users (analogous to the “Documents and Settings” directory in MS Windows). This is where we finish setting up the disks. As a result, you should get something like the following.




If everything is correct, then select “Yes” (as shown in the screenshot below). This is the last moment before writing the partition table to disk (so far all the settings we have made have been written exclusively to RAM PC). Well, here we go!




After recording the table, the installation of the Ubuntu Server 10.04 LTS OS itself will begin, it will take 5-7 minutes.




After the process is completed, we will be asked to enter the name of the future user. I'll enter my name. It will be used to send mail on behalf of this user.




After entering the name, we need to come up with a name account, the user under which we will log in. I used asus(this is not an advertisement :))







For security purposes, we will be offered to encrypt our home directory for free. We have nothing to hide, so we will refuse.

Note: When encrypting, there is a risk that in the event of problems with the hard drive, it will be difficult to recover the encrypted information.




We are asked to enter information about the proxy server to gain access to the Internet. Since we don’t have it yet, we’ll just leave the field empty. Select “Continue”.




Unlike money-hungry MS Windows, Ubuntu offers completely free and timely updates via the Internet. Let’s select the “install security updates automatically” option so as not to have to do this manually later.




Also, we will immediately be offered to install a couple of “daemons” (analogues of system services in Windows). Yes, this is a “scary” OS, there may even be “zombies” - frozen “demons”, and there are no icons :) For ease of configuration, we will select Open SSH server (so that if necessary, you can connect to the server remotely over the network using a terminal) .

Note: Selecting the desired item is done by pressing the space bar when the appropriate position is highlighted (see the hint line at the very bottom of the screen).




It's time to install the Grub bootloader. We reviewed this loader. We need it to run *NIX-like OSes, although it can boot almost any other OS. Click “Yes”.

  • The system is loaded at 0.4%,
  • The home directory uses 3.3% of 1009 Mb of space.
  • 3% of 512 Mb of RAM is used, which in megabytes is only 21 Mb. For comparison, MS Windows XP Pro SP3 after a “clean” installation (from the original disk) uses about 100Mb and initially “holds” 30 megabytes in the swap file.
  • Now there are 84 processes running, there are no logged-in users (because the information was taken before the user, i.e. we, logged in).
  • One network card under the name eth0 the IP address 172.30.2.3 is assigned
  • There are also 89 service packs and 67 security update packs available.

After installation, you need to update the OS; this will require about 70 megabytes to download from the Internet. Run the update command as root (administrator) sudo apt-get update which will update the list of available packages.

Since the command requires the rights of the super user “su” (super user), we will be asked for our password, enter it. The command entered next apt-get upgrade will start the package update process itself. After launch, the list of packages will be checked and updates will be offered; confirm the installation by pressing the “Y” key.




The “get update” command updates the list of available software, including only information about it (version, etc.), and the “upgrade” command directly updates the software (downloads it from the developer’s website new version and installs it).

Let's look at the same update procedure using the sudo command




After downloading the necessary packages, installation will begin, which may take several minutes.

Your server is now ready to go! But it still needs to be configured. This is what we will do in the next article.

The Unix operating system (as the progenitor of Linux) was designed primarily for server tasks, so most GNU utilities are console-based (that is, they work only in the command line of a Linux terminal), because there is no need for a graphical shell on the server. However, over time, the functionality of server services in Linux has grown so much that constantly editing configuration files from command line has become difficult and therefore there are currently a huge number of graphical administration tools (usually implemented in the form of a WEB interface) that greatly simplify the life of system administrators.

A huge number of commercial solutions and products run on Linux server services and utilities. Linux server can perform almost any server role. Briefly, I will try to talk about the main roles of Linux:

Linux File Server

Linux can quite easily act as a file server for both Windows users and for Linux. The main service for this is the Samba package, which allows you to access network drives and printers according to the protocol used in Windows networks. It has client and server parts. Is free software, released under the GPL license. Using Samba, it is possible to organize full file exchange between users with a clear distinction of access rights.

For more experienced system administrators I can say that Current version Samba server can act as a domain controller and service Active Directory(centralized management of computers and users working in the operating room Windows system), is capable of servicing all Microsoft supported Windows versions clients, including Windows 10. Previously, this was only possible with an expensive Microsoft Windows Server.


Database server

Almost all systems of any complexity and purpose cannot do without a database. It is no secret that almost all sites located on the Internet operate using a database that runs on the Linux platform (usually MySQL). Accounting systems (for example 1C), CRM, project systems and others all use databases. However, most previously written desktop applications (running on user computers) developed for Windows work using databases under this operating system. However, currently in Linux their number is simply huge, and the functionality is often not inferior to the most powerful competitors from Microsoft or Oracle. Most well-known Linux databases have their own versions for Windows. Currently, even the Russian developer company 1C is actively developing and supporting versions of its products running under Linux. The most popular are the following databases:

MySQL - a free relational database management system that is a solution for small and medium-sized applications.

PostgreSQL- a free object-relational database management system. With the help of this database, big data processing systems are built, and often it is PostgreSQL that competes with Oracle DB.


Email server

Like any other Linux server, it is very suitable for creating your own email server. Most of the free email services Google, Mail.ru, Yandex and others operate on Linux. Unlike the Windows platform (in which most functional servers are paid), Linux has a large number of different packages for running your own corporate or personal email service and they are provided for free. However, the popularity of Linux leads to the fact that most free solutions are modified, added to and sold for money. But it has its advantages - official support, constant updates, a convenient administration and control interface (not everyone likes working in the console).

Internet Server

This is a server that provides local network computers with access to the Internet. Such servers are often called (proxy servers) and they perform the following tasks:

  • Data caching: if there are frequent calls to the same external resources, then you can keep a copy of them on a proxy server and issue it upon request, thereby reducing the load on the channel to the external network and speeding up the receipt of the requested information.
  • Protecting the local network from external access: for example, you can configure a proxy server so that local computers will access external resources only through it, and external computers will not be able to access local ones at all (they “see” only the proxy server).
  • Restricting access from the local network to the external one: for example, you can deny access to certain websites, limit Internet use to some local users, set traffic or bandwidth quotas, filter ads and viruses.

Such servers are also very often deployed on Linux. The most common functional one is the Squid package. It is completely free, and its functionality when used in conjunction with Linux network services has a huge effect.


Telephone exchange (IP PBX - IP-PBX)

Communication and communications between employees are an integral part of almost any organization and, of course, communication is impossible without telephone communication. However, with the growth of technological solutions, the functionality and requirements for telephone communications have increased significantly. But afford expensive ones, functional systems Not everyone can afford it. It was the desire to get such a system that prompted the creators of the world's most popular telephone solution (Asterisk) to develop free analogue such a system in Linux.

Asterisk in combination with the necessary equipment, it has all the capabilities of a classic PBX, supports many VoIP protocols and provides rich call management functions, including:
Voice mail
Conference call
IVR (Interactive Voice Menu)
Call processing center (queuing calls and distributing them among subscribers using various algorithms)
Call Detail Record (detailed call record) and many other functions.

Thanks to the free license, Asterisk is actively developed and supported by thousands of people from all over the planet. Almost all “boxed” IP-PBXs run on Linux and Asterisk. This PBX works great on any low-budget systems, for example BananaPi :)



Asterisk on Banana Pi

Of course, this is a very small part of how Linux can be a server, so the possibilities are endless. Linux can be either a simple file server or a node in a powerful computing cluster in some research center. Linux server is mostly a constructor for specialists and geeks, but its possibilities are almost limitless.

Linux is a server



tell friends