Technically Speaking

The Official Bigstep Blog

 

Top Linux Web Servers: Pros and Cons

For a long time, Apache was the only option as a Linux web server and held almost a monopoly in the open-source market. Today, things have changed, and several open source web servers are available. Which one is best? We’ll try to answer the question in this blog post.

Apache

Apache is still the most widely use web server in the world, due to several reasons. It was released back in 1995 and it is available by default in most Linux distributions.

Pros

  • Easy to configure
  • Supports perdirectory settings using .htaccess files, which makes it ideal for shared hosting
  • Widely available documentation and tutorials
  • Has a dynamic module system that can be used to add new features
  • Offers a choice between several MultiProcessing Modules (MPMs) that handle connections

Cons

  • Not as fast as some of the newer alternatives
  • Can’t handle a large number of simultaneous requests
  • Updates are not very frequent and new technologies are integrated slowly

Nginx

Nginx was designed from the start as a solution to the limitations of the Apache web server, especially for its inability to handle thousands of concurrent connections.

Pros

  • High performance, in particular when serving static files
  • Built on an asynchronous architecture in order to handle high loads
  • Low memory usage
  • Supports many useful features such as load balancing, static and dynamic caching, reverse proxy setups or WebSockets
  • When used with PHP-FPM, it is the best option for Wordpress websites

Cons

  • Not suitable for shared hosting on its own, since there is no .htaccess-like feature
  • Modules are normally enabled during build time, and recompilation is needed in order to change them

Lighthttpd

Unlike its competitors, Lighthttpd was developed for a specific purpose, as a web server for systems with limited resources.

Pros

  • Very low CPU and RAM requirements
  • Handles requests asynchronously, similar to Nginx

Cons

  • Only uses a single CPU thread, so performance is limited
  • Lacks many advanced features
  • Suitable for small websites only

LiteSpeed

LiteSpeed comes in two versions: a free one known as OpenLiteSpeed and a paid enterprise version with extended functionality.

Pros

  • Very high performance due to its event-driven architecture
  • The enterprise version is fully compatible with Apache configuration files (including .htaccess and rewrite rules), so it can instantly replace it as a much faster web server for shared hosting
  • Comes with its own very effective php handler (lsapi)
  • Can be administered from a GUI interface
  • Advanced caching options, the paid version has modules tweaked for the most popular CMS and ecommerce platforms

Cons

  • Expensive license
  • The free version is limited and poorly documented

Caddy

Caddy is a newest entry on the list and was designed from the start to be as simple to configure as possible, while offering strong security features.

Pros

  • Very easy to install and configure with the default settings
  • The binary doesn’t need any dependencies or libraries, which makes it perfect for containers
  • HTTPS is enabled by default and certificates are renewed automatically
  • Can be controlled through an API
  • Supports load balancing, proxying, and WebSockets

Cons

  • Unsuitable for complex projects that require other settings than its defaults

Now that we know their advantages and disadvantages, which web server is the best? The answer depends on your use case. Nginx is a very fast and powerful option, Apache is a great general-purpose web server, while LiteSpeed represents a premium alternative. Caddy works great if you need simplicity, while Lighthttpd works best when resources are low.

In an extended infrastructure, you can combine the strengths of various web servers in order to create an effective setup. For example, Nginx can be the load balancer and serve static files, while Apache runs in the back-end on multiple servers, with per-directory settings.

Which web server do you use and why? Which features are more important for your use case? Let’s discuss. For any questions on servers and infrastructure, contact us anytime.

About the Author

Dragos Baldescu is a Level 2 Technical Support Engineer at Bigstep, passionate about Linux and testing out new technologies and solutions.

Got a question? Need advice? We're just one click away.
Sharing is caring:TwitterFacebookLinkedinPinterestEmail

Readers also enjoyed:

A Rookie Sysadmin’s Guide to Troubleshooting Wordpress

Wordpress is the most popular content management system with more than 60 million websites using it around the globe. It has many themes and…

Nginx in WHM, what is the best option?

For a long time, the only web server available in WHM was Apache, with Litespeed as a paid premium option. However, Nginx is widely considered today to…

Leave a Reply

Your email address will not be published.

* Required fields to post your comments.
Please review our Privacy Notice in order to understand how we process your personal data and what are your rights in this respect.