Ubuntu rocks!

The 8 Best Open Source Web Servers

It’s been a long journey since the first web server was released back in 1991. For quite a long time, Apache was the only mention-worthy webserver. Over time, however, other open-source web servers have gained traction.

In this guide, we look at some of the best opensource web servers.

1. Apache HTTP Server

Apache HTTP Server, colloquially known as Apache or httpd in Red Hat distributions is a free and opensource web server developed by Apache Software Foundation under Apache License version 2. Released in 1995, Apache has grown in leaps and bounds to become one of the most popular and widely used web servers, powering over 37% of all the websites.

Apache is written in C language and is a highly customizable webserver thanks to its tons of modules that extend the web server’s functionality. These include mod_file_cache for caching, mod_ftp to provide FTP support for file uploads and downloads, and mod_ssl that allows support for SSL / TLS encryption protocols, and many more.

Additionally, given its rich set of modules, Apache provides multi-protocol support such as both IPv4 and IPv6 support and the commonly used HTTP, HTTP/2, and HTTPS protocols.

Apache also offers virtual hosting support that allows you to host multiple domains or websites. Be configuring virtual hosts, a single server can host multiple domains with ease and without any complexities. You can have example.com, example.edu, example.info and so on.

Check Apache Webpage

Learn how to install the Apache webserver on Linux distributions using the following guides.

2. Nginx Web Server

Pronounced as Engine-X, Nginx is an opensource high-performance robust web server which also double-ups as a load balancer, reverse proxy, IMAP/POP3 proxy server, and API gateway. Initially developed by Igor Sysoev in 2004, Nginx has grown in popularity to edge out rivals and become one of the most stable and reliable web servers.

Nginx draws its prominence from its low resource utilization, scalability, and high concurrency. In fact, when properly tweaked, Nginx can handle up to 500,000 requests per second with low CPU utilization. For this reason, it’s the most ideal web server for hosting high-traffic websites and beats Apache hands down.

Popular sites running on Nginx include LinkedIn, Adobe, Xerox, Facebook, and Twitter to mention a few.

Nginx is lean on configurations making it easy to make tweaks and Just like Apache, it supports multiple protocols, SSL/TLS support, basic HTTP authentication, virtual hosting, load balancing, and URL rewriting to mention a few. Currently, Nginx commands a market share of 31% of all the websites hosted.

Читайте также:  Linux creating admin user

Check Nginx Web Page

Learn how to install the Nginx web server on Linux distributions using the following guides.

3. Lighttpd Web Server

Lighttpd is a free and opensource web server that is specifically designed for speed-critical applications. Unlike Apache and Nginx, it has a very small footprint (less than 1 MB) and is very economical with the server’s resources such as CPU utilization.

Distributed under the BSD license, Lighttpd runs natively on Linux/Unix systems but can also be installed in Microsoft Windows. It’s popular for its simplicity, easy set-up, performance, and module support.

Lighttpd’s architecture is optimized to handle a large volume of parallel connections which is crucial for high-performance web applications. The web server supports FastCGI, CGI, and SCGI for interfacing programs with the webserver. It also supports web applications written in a myriad of programming languages with special attention given to PHP, Python, Perl, and Ruby.

Other features include SSL/TLS support, HTTP compression using the mod_compress module, virtual hosting, and support for various modules.

Check Lighttpd Page

Learn how to install the Lighttpd web server on Linux distributions using the following guides.

4. Apache Tomcat

Apache Tomcat is an opensource implementation of Java servlet engine, Java Expression Language and Java Server web pages. It comes across as an ideal option for developers who are building and deploying Java-based applications.

Strictly speaking, Tomcat is not your ordinary web server like Nginx or Apache. It’s a Java servlet that comes with extended functionality for interacting with Java servlets while at the same time implementing technical specifications such as JavaServer Pages (JSP), and Java Expression Language (Java EL).

What sets Tomcat apart from other web servers it that it’s geared specifically to serve Java-based content. It was originally developed to provide JSP functionality which lacked in the Apache HTTP server.

You can run Apache Tomcat alongside Apache HTTP server in a scenario where you are handling projects with both PHP and Java content. Apache HTTP server can handle static & dynamic content as Tomcat handles the JSP functionality.

On its own, however, Apache Tomcat is not a fully-fledged webserver and not as efficient as traditional web servers like Nginx and Apache.

Apache Tomcat Dashboard

Learn how to install the Apache Tomcat on Linux distributions using the following guides.

5. Caddy Web Server

Written in Go, Caddy is a fast and powerful multiplatform web server that can also act as a reverse proxy, load balancer, and API gateway. Everything is built-in with no dependencies and this aspect makes Caddy easy to install and use.

By default, Caddy supports HTTPS and easily takes care of SSL/TLS certificate renewals. Lack of dependencies increases its portability across various distributions without any conflict in the libraries.

It’s an ideal web server for running applications written in GO and offers full support for IPv6 and HTTP/2 to enable fast HTTP requests. It also supports virtual hosting, advanced WebSockets technology, URL rewrites, and redirects, caching and static file serving with compression, and markdown rendering.

Читайте также:  Cryptopro установка корневого сертификата linux

Caddy has a very small market share and according to W3techs, it accounts for only 0.05% of the market share.

Caddy Web Server

Learn how to install the Caddy web server on Linux distributions using the following guides.

6. OpenLiteSpeed Web Server

OpenLiteSpeed is an open-source web server designed for speed, simplicity, security, and optimization. It’s based on the LiteSpeed Enterprise Web server edition and provides all the essential features in the Enterprise edition.

OpenLiteSpeed Admin Interface

OpenLiteSpeed web server rides on an event-driven, resource-friendly architecture and features a user-friendly WebAdmin GUI that helps you manage your domains/websites and monitor an array of metrics. It’s optimized to execute a wide spectrum of scripts such as Perl, Python, Ruby, and Java. OPenLiteSpeed supports both IPv4 and IPv6 with SSL/TLS support. IT provides support for TLS 1.0, 1.1, 1.2, and 1.3.

You also get to enjoy bandwidth throttling, intelligent-cache acceleration, HTTP request validation, and IP-based access control. Additionally, you will benefit from high-performance page caching, and the web server’s ability to handle thousands of concurrent connections.

Apart from acting as a web server, OpenLiteSpeed can serve a load balancer and reverse proxy. It’s free to download and is available under the GPLv3 license.

Learn how to install the OpenLiteSpeed web server on Linux distributions using the following guides.

7. Hiawatha Web Server

Written in C, Hiawatha is a lightweight and secure web server built for speed, security, and ease of use. It’s code and features are highly secure and can ward off XSS and SQL injection attacks. Hiawatha also allows you to monitor your server using a special monitoring tool.

Hiawatha Web Server

It’s also easy to install and comes with ample documentation to guide you through and give you all the information that you need. Hiawatha comes recommended for embedded systems or old servers that have low specifications.

8. NodeJS

This might come as a shocker. Yes, NodeJS is primarily an opensource and cross-platform server-side runtime environment used for building web applications in Javascript. However, it’s also bundled with an http module that provides a set of classes and functions that extend its functionality and enables it to play the role of a web server.

Access Nodejs App from Browser

Learn how to install the NodeJS on Linux distributions using the following guides.

Conclusion

While we have covered some of the best opensource web servers, the list is by no means cast in stone. If you feel we have left one a web server that should be featured in this list, give us a shout out.

Источник

Install and Configure Apache

Apache is an open source web server that’s available for Linux servers free of charge.

In this tutorial we’ll be going through the steps of setting up an Apache server.

What you’ll learn

What you’ll need

  • Ubuntu Server 16.04 LTS
  • Secure Shell (SSH) access to your server
  • Basic Linux command line knowledge

Got everything ready? Let’s move on to the next step!

Originally authored by Aden Padilla

2. Installing Apache

To install Apache, install the latest meta-package apache2 by running:

sudo apt update sudo apt install apache2 

After letting the command run, all required packages are installed and we can test it out by typing in our IP address for the web server.

Читайте также:  How to replace files in linux

Apache-Installed

If you see the page above, it means that Apache has been successfully installed on your server! Let’s move on.

3. Creating Your Own Website

By default, Apache comes with a basic site (the one that we saw in the previous step) enabled. We can modify its content in /var/www/html or settings by editing its Virtual Host file found in /etc/apache2/sites-enabled/000-default.conf .

We can modify how Apache handles incoming requests and have multiple sites running on the same server by editing its Virtual Hosts file.

Today, we’re going to leave the default Apache virtual host configuration pointing to www.example.com and set up our own at gci.example.com .

So let’s start by creating a folder for our new website in /var/www/ by running

We have it named gci here but any name will work, as long as we point to it in the virtual hosts configuration file later.

Now that we have a directory created for our site, lets have an HTML file in it. Let’s go into our newly created directory and create one by typing:

cd /var/www/gci/ nano index.html 

Paste the following code in the index.html file:

      

I'm running this website on an Ubuntu Server server!

Now let’s create a VirtualHost file so it’ll show up when we type in gci.example.com .

4. Setting up the VirtualHost Configuration File

We start this step by going into the configuration files directory:

cd /etc/apache2/sites-available/ 

Since Apache came with a default VirtualHost file, let’s use that as a base. ( gci.conf is used here to match our subdomain name):

sudo cp 000-default.conf gci.conf 

Now edit the configuration file:

We should have our email in ServerAdmin so users can reach you in case Apache experiences any error:

ServerAdmin yourname@example.com 

We also want the DocumentRoot directive to point to the directory our site files are hosted on:

The default file doesn’t come with a ServerName directive so we’ll have to add and define it by adding this line below the last directive:

This ensures people reach the right site instead of the default one when they type in gci.example.com .

Now that we’re done configuring our site, let’s save and activate it in the next step!

5. Activating VirtualHost file

After setting up our website, we need to activate the virtual hosts configuration file to enable it. We do that by running the following command in the configuration file directory:

You should see the following output

Enabling site gci. To activate the new configuration, you need to run: service apache2 reload root@ubuntu-server:/etc/apache2/sites-available# 

To load the new site, we restart Apache by typing:

End result

Final

Now is the moment of truth, let’s type our host name in a browser. Hooray!

Further reading:

Источник

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