What Are Servers?
The term server can take on different meanings based on the context in which it is used. It can refer to a software package you install on your computer or a hardware device running a server program. Just because the term server is used, doesn't mean that it is a high powered computer running in a huge server room somewhere. It can simply refer to a web server running on your local machine.
Server programs listen on a port on its own or through a secondary server. They typically have their own configuration file to control their behavior. There is no common format for these configuration files. Servers running on Unix or Linux machines typically use the OS's syslog service for message logging
There are many different kinds of servers. There are authentication servers that take a username and password and check it against its database of usernames and passwords. There are also MySQL servers that are programs built to create, store, and manage databases. Servers defined as authentication servers can also be web servers, or a server made to serve webpages, with MySQL Server running on it. Then the authentication process is performed by making the web server program talk to the MySQL Server program through a programming language called PHP.
Server programs can be free like the Apache web server that you install off the internet. Other times, servers can be highly advanced network monitoring programs that can cost thousands and thousands of dollars. The difference between free server software and expensive server software usually comes down to the fact that open source software is free to the public and proprietary software is usually not free and can actually get quite expensive. Paid software usually has the advantage of customer service.
Servers typically operate as multiple processes. At least one process listens on a network port, and when a new incoming connection is received, the listening process uses
fork() to create a new child process, which is then responsible for the new connection. The child, often called a worker process, terminates when the connection is closed. Meanwhile, the original listening process continues to listen on the network port. This process allows a server to easily handle many connections without much trouble.
fork() adds a significant amount of system overhead. Alternatively, high-performance TCP servers such as the Apache web server can create a number of worker process upon startup so that they are already there to handle connections as need. Servers that accept UDP packets simply receive data and react to it; they don't have connections to listen for.
Implementing standalone servers for every service can be inefficient. Each server must be separatly configurated to handle port listening, access control, and port configuration. These actions are performed in the same way for most services.
The inetd daemon standardizes network port access and interfaces between server programs and network ports. After you start inetd, it reads its configuration file and then listens on the defined network ports. As network connections come in, inetd attaches a newly started process to the connection.
A newer version of inetd called xinetd offers easier configuration and better access control, but xinetd itself is being phased out in favor of systemd, which can provide the same functionality through socket units.
Although inetd is no longer commonly used, its configuration shows everything necessary to setup a service. sshd can also be invoked by inetd rather than as a standalone server, as shown in this /etc/inetd.conf file:
ident stream tcp nowait root /usr/sbin/sshd sshd -i
The seven fields:
- Service name - The service name from
- Socket type - This is usually stream for TCP and dgram for UDP
- Protocol - The transport protocol, usually
- Datagram server behavior - For UDP, this is
nowait. Services using any other transport protocol should use
- User - The username to run the service. Add
.groupto set a group.
- Executeable - The program that inetd should connect to the service
- Arguments - The arguments for the executable. The first argument should be the name of the program.
Server programs can be running on the same machine or they can be distributed across multiple machines on the same network. It is very common for a web server program like Apache and a database server program like MySQL to be running on the same machine. When these servers are distributed across a network (a private LAN, not remotely), it is usually for security purposes. A security compromise on one server allows the other server to remain intact. If an authentication database server was remote from the web server, this would open a security risk passing login credentials over the internet. This is why authentication databases must be local to the requesting server.
When the word server is used in the context of hardware, the prices are very similar. You can find cheap old used blade servers, desktops, or even laptops to get the job done. These machines can cost as little as a hundred dollars if bought refurbished. On the other end of the spectrum, you can find yourself spending thousands and thousands of dollars if you want the latest technology available. Buying expensive hardware can be referred to as growing vertically, whereas buying many low-cost devices is referred to as growing horizontally. Growing horizontally offers redundancy, but requires more overhead management.
In summary, servers can perform many functions. In a network of multiple devices, servers play the role of the central device that is more powerful than these other client computers. It is very important as the owner of the server to back it up frequently and make sure that the server has all its security updates. The cost of servers can widely range. As the server becomes more and more of a household item, it is important to keep up to date on new programs and technologies. These programs and devices have the ability to greatly improve our lives through simplification and added functionality.
- Web Servers: httpd, apache, apache2
- SSH Daemon: sshd
- Mail Servers: sendmail, postfix, qmail
- Print Server: cupsd
- Network Filesystem (File-Sharing) Daemons: nfsd, mountd
- Windows File-Sharing Daemons: smbd, nmbd
- RPC Portmap Service Daemon: rpcbind