What is Apache HTTP Server? (Its Pros & Cons)

Ruby Goyal
5 min readJan 12, 2019

--

Which is the Apache HTTP server?

What are its key benefits and limitations?

Why should you go for it?

Let’s dive right in.

What is Apache HTTP Server?

Apache HTTP Server is an open-source cross-platform web server which is also known as “httpd” and Apache.

Some interesting facts about Apache are:-

  • Apache Software Foundation manages its brand and services.
  • The server is developed and maintained by an open community of developers under ASF.
  • Mostly run on Linux, Apache powers around 46% of all the website around the world.
  • It is the key component of the LAMP (Linux, Apache, MySQL, PHP) stack.

Basic Architecture

  • Process Driven Approach
  • Creates a new thread for each request.

Apache follows a multi-threaded approach. It provides a variety of multiple processing modules. These pre-modules are basically of three types of requests handling algorithm. Each is meant for different server-needs.

The MPMs (Multi-Processing Modules) provides a flexible architecture for choosing different connection and different handling algorithms.

Also, different versions of Apache 2 employ different procession modules.

The three main Apache MPMs are:

Old school Apache (2.2) uses mpm_worker, mpm_prefork, and mod_php. Whereas Apache 2.4 (new apache) is configured to use mpm_event, php-fpm.

By default, Apache 2.2 is configured in Pre-fork mode (mpm_prefork). It responds to a set number of processes, each of which can serve a single request at a time.

In other words, Apache creates a new thread every time to handle each connection request.

Thread: A thread is the smallest sequence of programmed instructions that can be managed independently by a scheduler. In most cases, a thread is a component of a process.

However, Apache’s basic architecture can lead to heavy resource consumption, thereby, can cause issues with the server (eg- slow speed).

Performance

2.1 Static Content

Static content or files are typically files stored on disk on the server computer, for example, CSS files, JavaScripts files or images. Apache handles static content using its conventional file-based method.

2.2 Dynamic Content

Apache can process dynamic content within the web server itself without having to rely on any external components. So, it can handle your creeds itself.

OS Support

  • Supports all Unix-like systems including Linux and BSD.
  • It fully supports MS-Windows

Apache runs on all kinds of Unix-like systems (e.g., Linux or BSD) and has full support for Microsoft Windows.

Distributed / Centralized Configuration

This architecture allows non-privileged users to control certain aspects of their website without granting them permission to edit the main config. This is big!

Request Interpretation

Provides the ability to interpret request. As a physical resource on the file system location that may need more abstract evaluation. It passes requests as file system locations.

Of course, Apache does use URI locations, but they are generally for more abstract resources. And while creating or configuring a Virtual host, Apache use directory blocks under the document root.

This preference for file system locations can also be seen in the use of .htaccess files for overriding specific directory configurations.

Feature Modules

Apache server has a rich set of features that can be enabled by installing one of the 60 official modules. There are also many other unofficial modules that can be easily found on the internet.

Its module system allows you to dynamically load or unload modules to satisfy your needs. Its modules can be turned ON or Off to add or remove functionality and to hook into the main server.

In short, Apache has several feature modules to meet your need but many of them are not used often.

Flexibility

Customizations to the web server can be done through riding modules. Apache has had dynamic module loading for the longest time, so all Apache modules support this.

Security

Apache makes sure that all the website that runs on its server are safe from any harm and hackers.

Thereby it offers configuration tips for DDoS attack handling, as well as the mod_evasive module for responding to HTTP DoS, DDoS, or brute force attacks.

Talking about security and Apache, you must read our detailed post on cPanel security. A secured cPanel means a secured website.

Support

Commercial Apache support is available from a number of third-party companies, such as OpenLogic, but no official list is maintained by the Apache Foundation. Apache server is meant to offer great support to all of its users.

Final Takeaway

i) Apache .htaccess

NGINX does not support something like the Apache’s .htaccess file. However, with Apache, you get an advantage to give the non-privileged users control over some important aspects of their website.

  • The users, obviously, are not permitted to edit the main configuration.
  • Using .htaccess files, you can override system-wide settings on a per-directory basis.
  • For optimal performance, include these .htaccess directives in the main configuration file(s).
  • In a shared hosting environment, Apache works better because of its .htaccess configuration.

ii) In case of functionality limitations — use Apache

Nginx has some core modules that are very important. Howbeit, there are some functionality limitations with Nginx.

In case of some limitations or needing to use extra modules that are not supported by Nginx, you might want to choose Apache instead.

Originally published at https://serverguy.com on January 12, 2019.

--

--

Ruby Goyal

As an expert technical writer, Ruby loves to write in-depth guides on web development & online marketing. When she is not writing, she loves to read & travel.