Apache · Configuration and operations
What are common Apache configuration mistakes?
Short answer
The common mistakes are AllowOverride All everywhere, a real site as the default vhost, missing ProxyPassReverse, rewrite loops, open forward proxying and skipping configtest. Most are configuration hygiene, not Apache limitations.
Apache is flexible enough to let a bad configuration work in testing and fail under load or attack. The recurring problems tend to be about scope, ordering and defaults rather than obscure directives.
- AllowOverride All on every directory, paying per-request parsing and exposing directives
- No explicit default virtual host, so unknown Host headers reach a real site
- ProxyPass without a matching ProxyPassReverse, leaking internal redirects
- Rewrite rules that match their own output and loop until a 500
- Leaving ProxyRequests On and creating an open forward proxy
- Mixing Apache 2.2 Order/Allow/Deny with 2.4 Require without understanding precedence
- Reloading without configtest and discovering a typo during a restart
- Loading many unused modules and increasing patch surface
- Serving .git, backups or environment files from the document root
- Setting timeouts and worker counts by copying a blog post instead of measuring
<VirtualHost *:443>
ServerName example.com
DocumentRoot /var/www/example/public
ProxyPass /api http://127.0.0.1:3000/api
ProxyPassReverse /api http://127.0.0.1:3000/api
<Directory "/var/www/example/public">
Options -Indexes +FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>Another frequent issue is assuming that a directive in a Location section and the same directive in a Directory section apply independently. They merge, and Location is processed later, so the effective value may not be what you expect. Use apachectl -S and targeted trace logging to see the real mapping.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Why is an explicit default virtual host important?
- 2How do you detect an open forward proxy?
- 3Why does mixing 2.2 and 2.4 access directives cause surprises?
- 4Which mistake causes the most production outages in your experience?
Say it in the interview
The mistakes I see most are scope and default problems: AllowOverride All, no catch-all vhost, missing ProxyPassReverse, and rewrite loops. Open ProxyRequests is a security incident waiting to happen. I prevent them with configtest, an explicit default host, minimal modules and a staging request matrix. Most are caught by reviewing the effective config, not by guessing.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Apache mock interview and get scored feedback on depth, clarity and confidence.