Apache HTTP Server configuration and tuning
Apache configured properly, without tying your hands.
Apache HTTP Server still powers a huge share of production applications: modular, stable and documented like few other pieces of software. Many CMSs, PHP applications and legacy software simply assume Apache and its .htaccess. We configure it for your real workload - not the distro's default file - so it stays fast, secure and free of constraints.
Overview
We work on Apache at every stage of its life: first installation, tuning an existing server, diagnosing a bottleneck or migrating to a different architecture. The starting point is always the configuration you actually run - virtual hosts, loaded modules, .htaccess rules layered over the years - which we bring back to a clean, versioned, predictable state.
Apache pays for its flexibility with a few well-known pitfalls: mod_php multiplying memory use, the prefork MPM capping concurrency, .htaccess files re-read on every request. These are solvable problems, almost always without switching web server. When Apache genuinely isn't the most efficient choice for your case, we say so openly: often it just needs Nginx in front as a cache, without throwing away anything that already works.
Typical problems we solve
- The site slows down at traffic peaks and the server runs out of memory → we migrate from mod_php to PHP-FPM with the event MPM and size the limits to your real numbers.
- Layered
.htaccessrules that contradict each other → a full audit, cleanup of duplicates and moving rules into the virtual host where it pays off. - Chained redirects that slow down pages and waste crawl budget → we rewrite the mod_rewrite rules cleanly and test them before release.
- An expired certificate and the site flagged as not secure → we automate issuance and renewal with Let's Encrypt and keep an eye on expiry dates.
- Pages served without compression or caching → we enable HTTP/2, Brotli and correct caching headers to bring down the TTFB.
- An inherited configuration nobody dares to touch → we rebuild it step by step on staging and document it, so it stops being a black box.
- Constant scans and anomalous requests against sensitive paths → hardening with security headers, request limits and unnecessary modules disabled.
What's included
- Virtual hosts: multiple sites on one server, name-based or IP-based, with separate logs, permissions and PHP pools so they can't interfere with each other.
- mod_rewrite and .htaccess: writing, cleaning and tuning redirects, rewrites and SEO-friendly URLs, tested before release.
- From mod_php to PHP-FPM: migration to PHP-FPM with the event MPM to cut memory use and raise concurrency, without breaking existing rules.
- Caching and compression: mod_cache, mod_expires, mod_deflate and Brotli, with headers tuned to bring down the TTFB.
- TLS and certificates: modern ciphers, HSTS, HTTP/2 and automatic renewal via Let's Encrypt.
- Hardening: security headers, sensitive paths locked down, limits on requests and body size, active modules trimmed to a minimal list.
- Coexistence or migration with Nginx: Apache behind Nginx as a caching layer, or a gradual translation of the rules over to Nginx.
Stack and technologies
We work on Apache 2.4 with the event MPM and PHP-FPM, the combination that today offers the best balance of memory use and concurrency. We enable only the modules that are actually needed - mod_rewrite, mod_ssl, mod_headers, mod_proxy, mod_cache - and wire in Let's Encrypt for certificates. Where the numbers justify it, we add Nginx or Varnish as a cache in front of Apache, and connect it all to log and performance monitoring. We work mainly on Debian and Ubuntu; on request also AlmaLinux, Rocky Linux, Arch Linux and other distributions. The server can live wherever you prefer: bare-metal, VPS or cloud - we mostly use Google Cloud, with AWS and DigitalOcean as alternatives. Every change lands in versioned, commented configuration, not in on-the-fly tweaks that nobody can explain six months later.
A real-world example
An agency handed us an inherited server running about ten WordPress sites on Apache in prefork mode with mod_php: at traffic peaks the memory would run out, the server would start swapping, and every site slowed down together. We replicated the configuration on staging, migrated to the event MPM with a dedicated PHP-FPM pool per site, cleaned duplicate rewrites out of the .htaccess files and turned on HTTP/2 with Brotli compression. The move to production happened in an agreed window, with no perceptible downtime. Today memory per request is a fraction of what it was, a traffic spike on one site no longer drags down the others, and the agency has a written map of virtual hosts and pools, site by site.
Who it's for
- PHP applications and CMSs - WordPress, Drupal, Magento - and legacy software that depend on
.htaccess. - Companies and agencies with an inherited Apache server that's poorly documented or slow under load.
- Anyone weighing a move to PHP-FPM with the event MPM, or introducing Nginx without rewriting everything.
- Teams hosting several sites on the same server who want clean virtual hosts, isolated from each other.
How we work
Before touching anything, we take a snapshot of the current state: loaded modules, virtual hosts, active rules and real memory usage. On that basis we propose the simplest intervention that carries the load, test it on staging and agree the release window with you. The configurations we leave you with are standard, open and documented: no proprietary components, no step that only we understand. You get a single technical point of contact and reports you can read without a dictionary. Standard coverage is Monday to Friday, 09:00-18:00, with priorities and timeframes described on the response times page; for work needed from time to time there are hour packages, which never expire, and for ongoing management the server management plans, at a fixed price. Quotes are always free, with a reply within one working day.
Frequently asked questions
Is it worth moving from mod_php to PHP-FPM with the event MPM?
In most cases, yes: each Apache process stops carrying its own PHP interpreter around, memory per request drops and concurrency goes up. We first check your .htaccess rules and active modules, test the migration on staging, then go live without breaking anything.
Can we keep Apache and put Nginx in front as a cache?
Yes - it's a setup we build often: Apache keeps serving the application with its existing .htaccess rules, and Nginx in front acts as reverse proxy and cache. You get most of the benefits without rewriting your existing configuration.
Do you clean up .htaccess and mod_rewrite rules built up over the years?
Yes. We audit the existing rules, remove duplicates and conflicts, rewrite redirects and SEO-friendly URLs and, where it pays off, move rules from .htaccess into the virtual host for better performance.
Do you configure modern TLS and HTTP/2 on Apache?
Yes. We enable HTTP/2, up-to-date ciphers and HSTS, and automate certificate issuance and renewal with Let's Encrypt, including expiry monitoring.
How much does work on Apache cost, and how long does it take?
There is a single rate for every technology. For ongoing management there are monitoring and server management plans, starting from €49/month; for work needed from time to time there are hour packages from €58/hour that never expire. Targeted tuning on a single server is usually wrapped up in a few hours; quotes are always free, with a reply within one working day.
If Apache goes down, how quickly do you respond?
Standard coverage is Monday to Friday, 09:00-18:00, with priority triage: for a P1 emergency - service down - during office hours we pick it up within one hour; out of hours within one hour with an on-call plan, otherwise within 24 hours if we already work together. Out of hours the on-call rules apply; work planned at least 20 days ahead remains possible at the out-of-hours rate, with no surprises on the invoice.
Do you also work at night or on weekends?
Yes, for emergencies. The on-call plan extends your office hours on the days you choose: we pick up a P1 within one hour at any hour and a P2 within 4 hours during the day, and the work costs the same as in office hours. Without a plan our hours are Mon-Fri 09:00-18:00: out of hours we still pick up a P1 within 24 hours, weekends and public holidays included, at the out-of-hours rate, if we already work together; everything else is best effort. Night or holiday work planned at least 20 days ahead remains available to everyone. Plans, rates and examples are on the On-call page.
Need a hand with your infrastructure?
Tell us the problem: we reply within one working day with a clear plan and a quote.