Working with Apache?

Apache .htaccess or redirects broken? We fix it.

Most Apache servers that reach us have been edited by half a dozen people over the years, with rewrite rules layered on top of rewrite rules that nobody remembers writing. We read what is actually there and sort it out without starting over.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

error.log

still failing

What it is

Apache at a glance

The Apache HTTP Server is an open-source web server first released in 1995 by the Apache Group, which later became the Apache Software Foundation. Its name comes from the phrase 'a patchy' server, because the early code was a collection of patches applied to the older NCSA HTTPd project.

It is modular, with features such as mod_rewrite, mod_ssl, mod_proxy and mod_security loaded as needed, and it has long been the default web server on most Linux distributions and shared hosting plans. It still powers a large share of the PHP sites on the internet, especially anything built on the classic LAMP stack.

Apache can run in several multi-processing modes: the old prefork model that pairs with mod_php, the threaded worker model, and the modern event model that handles more concurrent connections per process. Per-directory configuration through .htaccess files is both its best-known feature and the source of most of its support calls.

Type
Web server
First released
1995
License
Apache License 2.0
Maintained by
The Apache Software Foundation
Typically used for
PHP sites, the LAMP stack, shared hosting, intranets, and application backends behind a reverse proxy

The honest version

Apache pros and cons

No technology is all upside. This is where Apache earns its place and where it tends to cause trouble.

Where Apache is strong

  • It is everywhere alreadyNearly every shared host and Linux distribution ships Apache by default, so the people who need to work on your site have almost certainly worked on it before.
  • Per-directory configurationThe .htaccess model lets each folder carry its own rewrite and access rules, which is how most PHP applications expect to be deployed and why so many hosts standardise on it.
  • A very large module ecosystemYears of accumulated modules cover rewrites, SSL, proxying, authentication and web application firewalls, so most requirements are a configuration task rather than a code task.
  • Multi-processing options for different workloadsYou can choose prefork for classic mod_php stacks, worker for threaded workloads, or event for long-lived connections, all without swapping the server.
  • A long track recordApache has been shipping since 1995, which means almost every obscure behaviour has been hit, discussed and documented by somebody else already.
  • The default for most PHP sitesIf your application is PHP, chances are it was written and tested on Apache first, which saves a lot of integration guesswork.

Where Apache bites

  • Concurrency is not its strong pointWith the prefork MPM a busy site uses a lot of memory per request, and raw throughput falls behind Nginx long before the hardware is fully used.
  • .htaccess is easy to breakAnyone with FTP access can drop a bad directive into a .htaccess file and take the whole site down, and those files are hard to audit across a large tree.
  • The 2.2 to 2.4 syntax change still bitesOld configurations using Order, Allow and Deny silently stop working when a host upgrades, replaced by the Require directive from the new authorisation framework.
  • Modern HTTP tuning takes effortHTTP/2, modern TLS ciphers and sensible caching headers all need manual configuration, and defaults on long-lived installations are usually stuck in the past.
  • Memory per request grows quicklyEach child process keeps loaded modules and PHP interpreters in memory, so a few hundred concurrent requests can push a small server into swap.
  • MaxRequestWorkers tuning is a frequent missLeaving the setting at its default on a busy site produces queued connections and the familiar warning in the log, usually long after visitors have given up.

Sound familiar?

Common Apache problems we fix

The Apache problems that bring people to us, and what you have once each one is fixed.

500 Internal Server Error

A .htaccess change took the site down

A rewrite rule pasted from a forum, a directive from a module that is not loaded, or stray Windows line endings in an uploaded file.

Working rules, safely tested

301 goes to the wrong place

Redirects are not behaving

Rewrite rules fighting each other across nested .htaccess files, or conditions that worked on the old host but not the new one.

Redirects audited and consolidated

AH00072: could not bind to address

Apache refuses to start

A port already held by another service, a bad SSL certificate path, or a syntax error introduced by the last edit before the reboot.

Back up, with a sensible restart

Invalid command 'Order'

The site broke after a server upgrade

Apache 2.2 access rules that the new 2.4 authorisation framework no longer understands, often spread across dozens of virtual hosts.

Config brought up to 2.4

MaxRequestWorkers reached

The server runs out of workers at peak

Default MPM settings on a server that has long since outgrown them, with requests queued behind slow database calls.

MPM tuned to the real workload

mod_security: 403

Legitimate traffic is being blocked

A web application firewall rule set that is catching real users along with the attackers, with no record of who tuned it last.

Rules tuned, false positives cleared

SSLCertificateChainFile deprecated

The SSL config is from another era

Old certificate chain directives, weak ciphers, and no HTTP/2, usually on a host that has been upgraded underneath the configuration.

Modern TLS with a clean grade

no vhost documentation

Nobody knows what each virtual host does

Dozens of sites on one server with overlapping aliases, forgotten test hosts and includes pointing at files that no longer exist.

Virtual hosts documented and tidy

What we do

Apache help, from rescue to upkeep

Call us for one broken redirect, or hand us the whole server.

Rescue
Apache down, throwing 500s or refusing to start. We get it serving again first and find the cause second.
Rewrites and redirects
Audit of the .htaccess files, consolidation of rewrite rules, and redirects that go where they should on the first hop.
Upgrades
Bringing 2.2 era configuration forward to 2.4, with Order and Allow replaced by Require and tested before cutover.
Performance
MPM selection and tuning, HTTP/2, caching headers and keep-alive settings, measured before and after.
Migrations
Moving sites off tired shared hosting, or putting Nginx in front of Apache where it makes sense to.
Managed Tech
Patching, monitoring, and a team to call when something changes at three in the morning.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running Apache alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

Apache questions

Something else? Call+1 737 727 7327

Why is our .htaccess file causing 500 errors?

Almost always a directive that refers to a module which is not loaded, a syntax mistake in a rewrite rule, or Apache 2.2 access rules on a server that now runs 2.4. The server log names the exact file and line, which is where we start.

Can you move our site from Apache to Nginx?

Yes, when it makes sense. We translate the rewrite rules, replace .htaccess with server blocks, and test the new setup in parallel before changing DNS. Some sites are better off with Nginx in front of Apache instead.

How do we upgrade from Apache 2.2 to 2.4 syntax?

The main change is in access control: Order, Allow and Deny are replaced by the Require directive. We work through each virtual host and .htaccess file, test the result against real URLs, and only then swap the running config.

Why are our 301 redirects not working?

Usually rewrite rules in parent and child directories overriding each other, redirects configured in two places at once, or browser caching holding onto an older response. We trace the request from the first hop to the final page and fix whichever link in the chain is wrong.

Can you fix Apache after it stopped starting?

Yes. We read the error log, find the directive or port that is causing the failure, and bring the service back. If a configuration change caused it, we also leave you with a copy of the previous config saved.

How much does Apache help cost?

Estimates are free. Send over the httpd.conf or .htaccess and the error log you see, and we come back with a scope before touching the server.

Free estimate

Apache giving you trouble?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.