Lightweight web server linux

Best lightweight Linux server Distros without GUI

Most of the Linux server Distro can become an ultimate lightweight Linux server operating system if we use them in their minimal form. Although a wide range of open-source Linux distros can be used to perform server tasks by installing applications and tools needed by a server such as Apache, PHP, MySQL and more, the thing we have to make sure is the stability, Long term support and security. If you are going to opt any Linux Distro on your Server, you will never want it to be bloated or crashed oftentimes.

Lightweight Linux server Distros

If you see mainly Linux web server distros on commercial hosting providers servers or enterprises are without Graphical user interface, it is because the GUI makes Distros heavy and tend them to consume more RAM. Thus, we should avoid GUI on servers, moreover, even with GUI on Linux most of the time we work with command terminal only.

Thus, here are some popular distros with links to download their minimal ISO for lightweight without compromising the performance for home or commercial usage…

CentOS- minimal Small Distro

A lightweight server for both home and commercial users including Raspberry Pi.

If we look at the hosting service providers most of them are using CentOS as their Linux web server distro. The first reason is, it is a fork of most popular RedHat enterprise Linux, uses open-source code of the same; along with similar stability, Long Term support and security updates. One can install its minimal ISO image on their server hardware as a lightweight server OS for home as well as enterprise utilization.

Easily can be converted into Apache web server, Database server, Conatainred Docker and more…

The online world is full of tutorials on CentOS that means if you stuck somewhere, hundreds of howtos and forums will help you to cut the problem off.

If you are using Raspberry pi where one cannot install a heavy server operating systems, the small CentOS is available for that in the size of but around 220MB.

The Minimal ISO image of CentOS server is of around 900MB while full distro with GUI comes in the size of 4 GB.

Download CentOS Minimal ISO image

Ubuntu Server- Lightweight Minimal ISO

Another one of the most popular Linux distros amid both Desktop and Server users is Ubuntu, minimal ISO without GUI for lightweight installation.

It is available to install on a home machine with Graphical user interface and other tools to make the life easier of laypersons. Along with that Sever version in minimal form and as full-blown distros can be downloaded from the official website.

The best part of using Ubuntu is its extensive documentation support officially and from vast majority blogs and community; those have covered almost every issue of Ubuntu. Just like CentOS, one can use it as webserver distro, for Database, firewall, media server, email server or game server and more. The possibilities of usage are numerous. It is one of the most user-friendly Linux systems.

Читайте также:  What is tcp wrappers in linux

Compatible with most of the public clouds. Thus whether it is Google Cloud, DigitalOCean, Amazon Web server etc, you will find Ubuntu lightweight server distro next to CentOS.

Available for 64-bit PC (amd64, x86_64), 32-bit PC (i386, x86), 64-bit PowerPC (ppc64), and 32-bit PowerPC (ppc) systems.

Download Ubuntu minimal ISO. Also know: how to install Ubuntu minimal ISO.

Fedora Server

Fedora is another great server operating system built on Linux and Patreon by RedHat itself.

It is community-based and is rapidly adopting technical innovations. Tested and proven functions are then taken over in RedHat, which is offered to companies.

It is available as “Fedora Workstation” for Desktop and “Fedora Server” for Server hardware. To install it as a lightweight server a user either can go for NetInstall ISO image or while installing it as regular OS, server option for software or environment can be selected to reduce its size and resource consumptions.

Fedora-server-software-selection-to-make-lighweight

The software and functions are mostly up-to-date, so they can run smoothly without any quirks.

Debian Stable Server

Install minimal installation with command-line UI using lightweight Debian Linux server distro’s netinst CD image which is of 300 MB only.

Although we already have covered the Ubuntu server which is based on Debian, it is worth to mention the upstream source of the same i.e Debian. Debian has been used by lots of different Linux distros as a base OS, thus it is cynosure whenever we have a talk on lightweight server distros. Just like Centos and Ubuntu, you can find it on almost every Cloud service provider as server Linux distro.

It is very stable and can be customized greatly as per server needs. One of the biggest advantages is the versatile package system Dpkg (apt-get, gnome-apt), through which you can install countless programs and functions.

Debian can be installed and set up as both a desktop and server operating system. Install the command line and minimal installation using netinst CD image which is of 300 MB only and require an internet connection to download rest of the important packages.

Download Debian netinst CD image

OpenSUSE Server

OpenSUSE, an open-source arm of SUSE enterprise Linux distribution. We can install its light and small Linux version by simply selecting the minimal server installation option.

Like most of the Linux operating systems, the OpenSUSE also comes with lots of possibilities, it can be used as a home server operating system for Workstation, Desktops and Laptops or rather install its Server version with the text-based interface and minimum supported packages for commercial usage; the choice is all yours.

OpenSUSE-server-for-lightweight-and-small-space-PC

It is available in two forms OpenSUSE TumbleWeed and OpenSUSE Leap. One has Long Term support and others for those need frequent updates and most recent software versions.

So, these were some best Linux Distros those can be used as LightWeight OS for Server hardware. Apart from them, as I said you can use any Linux Distro for server tools installation, thus if you want an OS for home usage then you can see:

Читайте также:  Hp 6230 драйвер линукс

Apart from other servers, one more OS here, extremely small. Once can try it for home or office server usage to test thing on very old hardware server machines:

4MLinux Server: A small size Linux OS to create Miniserver as DNS, FTP, HTTP, MySQL, NFS, Proxy, SMTP, SSH, and Telnet. A proxy server (Polipo with optional Tor support) is also included. Only needs 128 MB of RAM. Website.

Источник

Configure Lighttpd

Lighttpd or Lighty is a free and open-source web server developed for high-performance environments. Lighttpd server is lightweight, high-speed, and secure. It is mainly provided as an alternative to web servers such as Apache because it consumes very few resources such as CPU and memory.

Lighttpd can handle more than 10000 parallel connections on a single server; it is often an excellent option for high-traffic sites.

This guide will walk you through installing and configuring the Lighttpd server.

Requirements.

To follow along with this guide, you will require the following:

  1. A fresh install of the Ubuntu/Debian server.
  2. A root or sudo account.
  3. Internet connectivity.

Install Lighttpd server

The first step is to install the Lighttpd server on our system. Open the terminal and update the system repositories.

Proceed to install the Lighttpd package using apt. Lighttpd server is available on the Debian/Ubuntu repositories.

Once the installation process is complete, start the service using systemctl as:

Check if the Lighttpd service is running:

Open the browser and navigate your machine’s IP address to access the webserver. You should see the default Lighttpd page as:

Configuring Lighttpd

After installation, it is good to customize the Lighttpd server for various options and needs. In this section, we will discover important configuration files and directives.

The main configuration file for the Lighttpd server is located in /etc/lighttpd/lighttpd.conf. It contains a collection of modules that are applied during server startup. If you want to make changes to the Lighttpd server, this is the place to do it

Basics

To view the contents of the file, you can use your favorite text editor or use the cat command as:

The Lighttpd configuration file starts with the server.modules block. This module contains a list of server modules that are applied during server startup.

You enable a module by adding it to the list separated by commas.

To disable a module, add a pound sign (#) at the start of the module name. Adding a # sign will comment out the line, which will be ignored when the server starts.

The server will load each enabled module in the order it appears.

After the server.modules block comes to a list of settings that modify the behavior of the webserver. Most of these settings are straightforward and descriptive. Such settings include:

  1. server.document-root – Defines the default document root for your web server.
  2. server.port – the default listen port for the webserver.
  3. server.username – specifies the username for starting and stopping the server. If not specified, it defaults to the root user.
  4. server.groupname – the group of the user for managing the server.
  5. server.errorlog – sets the path to the error log file.

Although not enabled by default, you can add the following settings to modify various settings for the server.

  1. server.bind – specifies the IP address or hostname on which the server will listen. By default, the server will bind to all addresses.
  2. server.max-connections – defines the maximum number of synchronized connections.
Читайте также:  Команды форматирования в линукс

The next block are HTTP parse request options. The values in this block follow a syntax as shown below:

Standard options in this block include:

  1. header-strict – if enabled, this option defines the maximum number of characters allowed in an HTTP request header.
  2. host-strict – this option is similar to header-strict. However, it limits the max characters in an HTTP request Host header.
  3. url-path-backslash-trans – if this option is enabled, the server will translate a backslash to a forward slash. This is useful when you are running the server on a Windows machine.
  4. url-path-dotseg-remove – if enabled, the server will resolve and remove the . and .. in path segments.

The above are some common HTTP parse options for the Lighttpd server. You can learn more by checking the documentation.

Enable Lighttpd modules

One way to enable and disable modules for the Ligttpd server is to edit the configuration file. However, you can use the command-line utility, which removes the need to edit the configuration file.

To enable a module from the command line, enter the command below followed by the module’s name to enable.

For example, to enable rewrite, use the command:

Once you invoke the lighttpd-enable-mod command, the utility will create a symlink to the module’s config file. Modules enabled are located in the /etc/lighttpd/conf-enabled directory.

For example, enable the auth module as:

To view the enabled modules, list the files in the directory as:

Each enabled module ends with .conf, as shown in the example above. To view the available modules, locate the conf-available directory:

Disable Lighttpd modules

To disable modules, you can use the lighttpd-disable-mod command followed by the module’s name to deactivate.

$ sudo lighttpd-disable-mod auth
Disabling rewrite
Run «service lighttpd force-reload» to enable changes

Enabling Dynamic Content

By default, the Lighttpd server will not serve any dynamic content such as PHP, Ruby, Python, or other supported languages. You need to allow the server to execute scripts by enabling the FastCGI module to solve this.

In this example, we will show you how to enable PHP support on the server.

Start by installing the required packages.

Next, enable the fastCGI module on the Lighttpd server:

Next, edit the PHP configuration file and change the listen PHP listen port to 9001

Locate the following block

Restart the fmp service as:

The next step is to edit the FastCGI config file.

Locate the following entries:

Change the entries to as shown below:

Finally, reload the services:

That is it for this tutorial.

Closing

In this tutorial, you learned how to set up the Lighttpd server on your machine and enable support for PHP and FastCGI on Lighttpd.

Stay tuned for more tutorials.

About the author

John Otieno

My name is John and am a fellow geek like you. I am passionate about all things computers from Hardware, Operating systems to Programming. My dream is to share my knowledge with the world and help out fellow geeks. Follow my content by subscribing to LinuxHint mailing list

Источник

Оцените статью
Adblock
detector