ansible/apache
1
0
Fork
You've already forked apache
0
Ansible role that installs Apache web server
Jinja 100%
taha@asks2 c8fbe42e01 Major refactor. Also added support for Ubuntu 24.
Complete overhaul of how default variables are handled (more in
line with most of my other roles). Tested on Ubuntu 24.04.
+ updated README.
+ added GPL license (no longer mentioning MIT license in README).
+ overhaul of defaults has allowed me to finally ditch the
 "host_restrictions" and "role_constraints" variables, which
 were never a smart approach to start.
2025年11月14日 21:09:03 +01:00
defaults/main Major refactor. Also added support for Ubuntu 24. 2025年11月14日 21:09:03 +01:00
handlers Major refactor. Also added support for Ubuntu 24. 2025年11月14日 21:09:03 +01:00
tasks Major refactor. Also added support for Ubuntu 24. 2025年11月14日 21:09:03 +01:00
templates Major refactor. Also added support for Ubuntu 24. 2025年11月14日 21:09:03 +01:00
vars Major refactor. Also added support for Ubuntu 24. 2025年11月14日 21:09:03 +01:00
.gitignore Installs Apache configured for mpm-event and PHP-FPM 2021年03月15日 00:58:23 +01:00
LICENSE Major refactor. Also added support for Ubuntu 24. 2025年11月14日 21:09:03 +01:00
README.md Major refactor. Also added support for Ubuntu 24. 2025年11月14日 21:09:03 +01:00

Apache web server

This role installs Apache from aptitude on Ubuntu 24 (previously tested on 18/20/22).

This role is configured to setup Apache mpm-event with php-fpm. This role enables SSL configuration by default. Furthermore, this role does not enable HSTS nor OCSP by default.

Choice of process module and process manager for Apache/PHP

Apache has three different MPMs:

  • Pre-fork
  • Worker
  • Event

PHP-FPM is the FastCGI Process Manager for PHP. FastCGI is based on CGI of yore.

The modern default MPM is event, but installing the process manager mod_php (it's unclear to me if this is still the default) forces Apache to run with the elderly mpm-prefork.

This is quite nicely explained in this DigitalOcean tutorial, which shows how to configure mpm-event with php-fpm.

And also in this Arstechnica article showing how to configure php-fpm (but being a little more unclear on worker/event configuration).

So it sounds like the modern "default" is MPM Event with PHP-FPM. For best performance, we should probably tweak the settings manually (the Ars article has good tips) but I assume the defaults should be enough for most of my needs.

Apache modules

You can inspect the currently enabled Apache mods in this way:

$ ls -1 /etc/apache2/mods-enabled/ | grep \\.load