What is Apache?
Apache is a free open-source web server software well-suited for a diverse set of computer types and software packages. The two main reasons for its popularity are its flexibility when it comes to configuration and its success in enabling large-scale projects.
Overview
Apache HTTP Server has been one of the two most popular web servers for more than 25 years. Currently, it is used by around a third of all existing servers, including projects like eBay, PayPal, and Facebook. This popularity has led to significant advantages, such as detailed documentation and an active community.
Usage for WordPress
Before you get a WordPress website, you need to choose a web server to host it on, and Apache is a great option. Installing and configuring WordPress on Apache is relatively easy, and there are many instructions you can follow online. However, if you’re using managed WP hosting, your hosting provider will take care of server management.
Main Features
These are the main advantages Apache is:
- Accessible: Apache is free and open-source, which means developers from all around the world work to add useful features and extensions tailored to very specific needs. Needless to say, the end product only benefits from these additions.
- Flexible when it comes to configuration: Apache uses a few config files to control the server, which means it’s easy to set it up to serve very particular narrowly-defined purposes.
- Functional: Thanks to its dynamic modular structure, Apache allows users to easily extend functionality by downloading modules. This solves many important issues in matters of security, URL editing, caching, etc. There is the option of turning off unused modules to accelerate the web server. Hybrid modules let Apache successfully serve both static and dynamic webpages.
- Versatile: Apache works similarly on a variety of platforms, from Windows to Linux.
- Compatible: Since Apache works on the basis of web-oriented programming languages (PHP, Python, Ruby, etc.), it’s compatible with the widest range of databases and server software. A myriad of tools and apps already come with respective PHP module to be launched via Apache. The web server supports FastCGI and CGI, enabling the use of software written in Java, C, C++, etc.
- Scalable: The web server is suitable for projects of any size, from a one-page static website to multi-page dynamic site with tens of thousand daily visitors.
- Equipped with great support: Any issue you encounter with Apache has probably been encountered and resolved by another user. There is a vibrant community and in-depth documentation to support you along the way.
But of course, there are also downsides:
- Low productivity: The speed of requests’ processing is somewhat lower than that of the competitors. The server’s flexibility and multi-functionality hinders its productivity at times.
- Vulnerability that comes from complexity of configs: The larger the number of modules, the more difficult it is to configure the server. This means the probability of missing an important security threat also goes up.
- Too many “extra” modules: Most users don’t make use of most of the opportunities Apache offers, which is why they tend to spend time turning the “extra” modules off.
Apache vs Nginx
The two most popular web servers, that handle more than 50% of the internet, are similar in many ways. The most important difference between Apache and Nginx is the way they work “under the hood.”
Apache | Nginx | |
Connections handled | A bunch of multi-processing modules (MPMs) dictate how client requests are handled. This makes Apache’s resource consumption pretty high. | Uses an asynchronous, non-blocking, event-driven connection handling algorithm. This makes Nginx able to scale even with very limited resources. |
Dynamic Webpages | Can handle them. | Can’t handle them natively. |
Configuration Settings | Distributed: Can allow non-admin users access to certain directories. | Centralized: Doesn’t allow select access. |
Modules | Dynamically loadable | Have to be selected and compiled into the core |
There’s a great Chris Lea quote that reflects these differences quite well: “Apache is like Microsoft Word, it has a million options but you only need six. Nginx does those six things, and it does five of them 50 times faster than Apache.”
Ultimately, the choice will depend on the needs of your particular project, but if you know how to configure it well, Nginx will render a better performance. And then, you may even opt to use both web servers together, leaving the static pages to Nginx and redirecting scripts’ processing to Apache.