Introduction
Linux is an open source operating system originally created by Linus Torvalds. Linux servers are computers that run the Linux operating system and provide services to other devices on a network.
Servers running Linux are powering many of the world’s top websites and networks, both at home and at work.
Among the reasons Linux servers have become so popular is their adaptability, performance, and pricing. Installing and running the most popular server software packages in Linux to deliver services to your network customers is covered in detail in this chapter.
For the sake of clarity, we’ll define the terms “Linux server” and “Linux desktop” separately before diving into the specifics of how each works.
Linux servers and desktops share the same Linux kernel, shells, and even apps that may be executed on both systems. When it comes to what programs they run and how those programs are executed, there is a big difference.
Many personal tasks, like as browsing the web or editing documents, may be performed on a Linux desktop using a graphical user interface. With the graphical desktop, users can easily access the operating system, as well as all of their data and apps. Selecting an application from the menu or clicking an icon on the desktop activates it. Everything is interactive on the desktop.
Most Linux servers are self-contained and do not need any human intervention. A desktop user isn’t running programs (and many servers don’t even have a dedicated display and keyboard).
In a networked environment, a server executes programs that give shared resources (called services) to a number of users (clients). Even when no one is using them, many services continue to function in the background.
There are few server apps that need a graphical user experience. It’s more common for them to use the Linux shell’s command-line interface (CLI), which connects to a server through a remote client for any interactive work with the services there.
Servers must be able to start the programs that give services to clients on their own since there is minimal contact with a human operator. Depending on the server and the service, these services may be operated in a variety of ways. In the following sections, we’ll explain how Linux servers launch services and how those services are made available to clients.
How to Launch Services in Linux Server
It is possible to launch service applications on Linux servers in one of two ways:
- Running in the background, listening for requests at all times.
- It is created by an application that waits for requests from a parent application
A daemon is a Linux service application that runs continuously in the background. As soon as a Linux server starts, scripts are often used to start service daemons.
The letter d is often used to identify daemon processes in Linux.
below is the command to list server daemon process on linux
ps -aux
In Linux, the term “daemon” rather than “demon” is used to refer to a background process. In Greek mythology, daemons were powerful supernatural entities that aided people in times of need.
It is necessary for a Linux server to have an increasing number of daemon processes operating in the background in order to handle the increased number of services it may provide. Even if a daemon is just listening for clients, it still consumes server RAM. Server RAM is plentiful now, but that wasn’t always the case when Linux was first developed. As a result, the need for super-servers arose.
It is possible to run numerous separate apps on the same super-server. When a client requests a service from the super-server, the corresponding service program is launched.
The internet daemon (inetd) was the first Linux super-server software. Whenever a client sends a request, the inetd daemon listens for it and starts the necessary service. To specify the services for which inetd handles requests, you may use the /etc/inetd.conf configuration file provided by the inetd software.
xinetd is a more powerful version of the inetd program. ACLs, comprehensive logging tools, and the ability to establish schedules to switch services on and off at various times of the day or week are just some of the other features included in this product.
Daemon Process
The number of programs and services that may be run on a Linux server is staggering. In most cases, a single Linux server can accommodate a number of different services at once. As a result, the server will be swamped with requests for a variety of services from many different clients. Clients’ requests must be matched with server services in order for this to work.
Each service, whether it’s a daemon or a super-server, communicates with its clients via a different network protocol. As part of the Internet Engineering Task Force (IETF), common service protocols are defined and published as RFC publications. Depending on the service, a web server may connect with its customers over HTTP while an email server may communicate via SMTP.
An internet service’s pre-determined network ports are used to establish how network clients connect with the service. The TCP and UDP protocols specify ports to isolate network communication destined for the same IP address from other traffic. The Internet Engineering Task Force (IETF) uses various ports for different services. Similar to phone extensions in a huge company, this operates the same way. You call the company’s main phone number and then choose a particular employee’s extension to get in touch with them. Clients connect to a server through a common IP address and then to distinct services via separate ports.
The Internet Engineering Task Force (IETF) has established a standard set of ports for popular Internet services. Some call them “famous ports.”
Port number | Protocol |
20 and 21 | FTP |
22 | SSH |
23 | Telnet |
25 | SMTP |
53 | DNS |
67 | DHCP |
80 | HTTP |
109 and 110 | POP |
137–139 | SMB |
143,220 | IMAP |
389 | LDAP |
443 | HTTPS |
2049 | NFS |
A wide range of Linux services may be used to provide network-based application services to network users. All of the Linux server’s ports are listed in the /etc/services file.
In the following sections, we’ll discuss the many services you’ll find on Linux servers, as well as the most popular Linux programs that deliver those services.
Linux Server Services
Among the most common Internet services, Linux servers are recognized for their ability to perform effectively. Linux servers provide the following Internet services:
- Web services
- Database services
- Email services
Web Servers
The most common usage of Linux servers on the Internet is to function as a web server. Many of the most popular websites are hosted on Linux-based web servers.
The same is true for Linux web servers, which may be built using a variety of different tools. These are the most often seen and should be familiar with.
Apache
It is a free and open source web server.
By far, the most common web server on the Internet is Apache. The National Center for Supercomputing Applications (NCSA) at the University of Illinois produced the first web server software package.
Modularity is one of the reasons Apache has grown so popular. The Apache server has a plug-in module for every advanced capability. An administrator of a server may select exactly whatever modules it requires for a certain application if functionalities are implemented as modules. As a result, the system’s Apache server daemons use less RAM.
nginx
the nginX web server is pronounced “engine-X.” Since its first release in 2004, nginX has evolved into a powerful alternative to Apache, allowing it to function as a web proxy, mail proxy, cache for web pages, and even a server for load balancing.
For high-volume situations, the nginX core program has a reduced memory footprint than the bigger Apache software. It can handle more than 10,000 network connections at once.
Even though the nginX web server has only been around for a few years, it is becoming more popular in high-traffic online settings. As a load-balancing front end for numerous Apache servers on the backend, one setup is becoming more common. Apache’s ability to handle dynamic web applications and the nginX server’s ability to handle huge traffic levels are used here.
Database Servers
`Most applications need the ability to store and retrieve data. While basic text files are sufficient for simple data storage applications, there are situations when more complex data storage strategies are necessary..
The relational database made it possible for programs to store and retrieve data fast and easily. Multiple users might view the same data at the same time with relational database servers. Clients may submit queries to the database server and obtain data using SQL, which is a standard query language.
A small number of high-quality open-source databases have climbed to the top in the Linux world despite the availability of numerous popular commercial database servers for Unix, Windows, and even Linux itself. Even though they are free, these database server software may occasionally outperform more costly commercial database packages in terms of performance.
Three of the most common open-source database servers for Linux are discussed in the following sections.
The PostgreSQL Database Engine
In 1996, the PostgreSQL database server was made accessible to the general public as an open-source project. Developers wanted to create a full object-relational database management system that could compete with the most popular commercial database servers of its day.
PostgreSQL is noted for its extensive database capabilities.. ACID rules are followed, and all of the fancy features you’d expect to see in a professional relational database server are supported, including transactions, updatable views and triggers, as well as foreign keys and functions and stored procedure calls.
A great deal of flexibility comes at the price of complexity, and PostgreSQL is no exception. The PostgreSQL database used to have a bad rap for being sluggish, but that’s all changed recently. Unfortunately, PostgreSQL still has a hard time gaining traction in the online world because of its bad image.
MySQL database management system.
PostgreSQL, on the other hand, was initially designed to compete with commercial databases. To begin with, it was only a rudimentary database system that could be accessed quickly. Fancy database features were not implemented; just the most basic functions were provided.
Many high-profile Internet web applications now rely on MySQL as their primary database server because of its emphasis on speed. There are a lot of Linux servers throughout the globe that are using the LAMP platform that includes Apache web server and the MySQL database server as well as the PHP programming language.
Since its debut, MySQL’s feature set has grown to the point that it now rivals that of commercial databases like PostgreSQL. As a result, MySQL still has the option of using the fast storage engine that made it renowned.
MongoDB
The usage of object-oriented databases has grown in tandem with the popularity of object-oriented programming and application architecture. NoSQL is now the most common object-oriented approach of storing data.
NoSQL databases, as the name implies, store data in a different way than standard SQL-based relational databases. There are no tables in a NoSQL database; instead, the data is stored as individual documents. Unlike relational tables, each NoSQL document may include a distinct set of data items, each of which is completely separate from the rest of the database’s data..
MongoDB, a NoSQL database suite, is becoming more popular. In 2009, MongoDB, a fully NoSQL-compliant database management system, was published. It uses JavaScript Object Notation (JSON) components to hold data records, making each page distinct from the rest.
There are several relational database capabilities supported by the MongoDB server, including as indexes, querying and even load balancing. It’s a powerful data-querying tool since it lets you use JavaScript in your queries.
Mail Servers
Email was once the Internet’s backbone. All of the world’s people had email addresses, and being hooked into the world’s email server was essential to keeping in touch. Email, despite the rise of other technologies like texting, tweeting, and messaging, is still a key function for most Internet users. Almost every Linux server installation has an email server installed by default.
For sending and receiving email, Linux employs a number of tiny applications that function in concert.
There are three main purposes of a Linux email server:
- The postal service’s mail-transfer agent (MTA)
- The postman or postal worker (MDA)
- The user agent for email (MUA)
MUA is the application that allows users to read and interact with their email messages. Because of this, MUA applications are often executed on the client side rather than the server side. When using Linux as a desktop operating system, it is common to use graphical email clients such as Evolution or K-Mail. The Linux server is where you’ll find the MTA and MDA utilities. Following is a list of the most commonly used MTAs and MDAs in Linux.
The Transfer Agent for the Postal Service
The server’s mail transfer agent (MTA) is in charge of both receiving and sending email. The MTA determines the recipient’s destination host for each message it sends. The MTA must connect to another MTA software on the remote system in order to transmit the message if the destination host is a remote mail server.
The Linux+ test focuses on three MTA software packages for the Linux environment: Postfix, Eudora, and SquirrelMail.
- Because of its broad range of capabilities, the sendmail MTA package has grown in popularity. Sendmail features such as virtual domains, message forwarding, user aliases, mail lists, and host masquerade have become commonplace in email systems. Unfortunately, setting up sendmail properly is a time-consuming and frustrating process. It has a huge configuration file that might be difficult for rookie mail administrators to navigate.
- When developing the Postfix MTA, multiple different programs were used to provide MTA capabilities in a modular fashion. Postfix’s simplicity is one of its finest advantages. Postfix does not employ a single huge configuration file to specify all of its features; instead, it makes use of two short configuration files that include just plaintext parameters and value names.
- With the Exim MTA package, all email operations are handled by a single huge application, following in the footsteps of the Sendmail approach. Since communications are sent immediately in most cases, the system avoids queuing messages wherever possible.
The Mail Delivery Agent
To send messages to local users, Linux distributions often depend on stand-alone mail delivery agents (MDAs). Because MDA programs only transmit messages to local users, they are possible to offer features that MTA programs without MDA capabilities do not have.
Sending messages to local users from the MTA program is handled by the MDA program. By using filters, messages may be sent to a different place than the local user account if the user so desires.
In Linux, there are two popular MDA programs:
- The most widely used MDA software under Linux is binmail. Its name is derived from its default system directory, /bin/mail. Because of its simplicity, it has become a popular choice. /var/spool/mail is the default location for email messages, but you may specify a different location if necessary.
- Since it was created by Stephen R. van den Berg and became so popular, several Linux distributions include it by default. As a result of its ability to create user-configured recipes, procmail has become one of the most popular mail servers on the market. It is possible to build an individual $HOME/.procmailrc file for each user, which may be used to route messages based on regular expressions to distinct mailbox files or even to forward messages to alternative email accounts.