
To run Drupal on Apache2 HTTP server, several modules are required and few are recommended for proper functionality. These modules allow Drupal interact with the web server effectively, provide needed URL rewriting, handling various content types and many more.
Apache2 uses a modular architecture, allowing users to extend its functionality by enabling or disabling specific modules. This will be used in current tutorial, to show how to enable or install missing modules. (In most cases, all required modules for Drupal is already installed, but not enabled)
Find full list of existing Apache2 HTTP server modules with detailed description can be at official Apache2 site, https://httpd.apache.org/docs/2.4/mod/
Prerequisites:
We have Ubuntu 22.04 OS, Apache2 web server, installed PHP8.1, Drupal 10
Information:
Here's a list of the essential Apache2 modules with short description for Drupal:
mod_rewrite
: Enables URL rewriting, which is required for Drupal's clean URLs.mod_ssl
: Must have to provide HTTPS, this module is required to enable SSL/TLS support.mod_headers
: Required for handling HTTP headers, which Drupal uses for cache control and other purposes.mod_expires
: Used to set expiration dates for various content types, which is important for caching.mod_deflate
: Compresses content before sending it to the client, which helps reduce load times.mod_filter
: Allows for dynamic content filtering. (Enabled by default)mod_dir
: Provides support for Apache's directory handling, provide default index page. (Enabled by default)mod_mime
: Maps file extensions to MIME types, helping Drupal manage different content types. (Enabled by default)mod_negotiation
: Helps with content negotiation in multilingual setups.prefork
: Helps with content negotiation in multilingual setups. (Enabled by default) mod_env
: Provide access to environment variables.mod_alias
: Provides for mapping different parts of the host filesystem in the document tree and for URL redirection.
PHP related modules:
(depending on used version)php-fpm
: This is necessary to execute PHP scripts (Using Proxy/CGI technology).php8.1
: Execute PHP scripts (version specific php8.1).php8.3
: Execute PHP scripts (version specific php8.3 for Drupal 11).
Additional modules if used php-fpm or proxy or reverse proxy:setenvif
: Allows the setting of environment variables based on characteristics of the request.proxy
: Multi-protocol proxy/gateway server.proxy_http
: HTTP support module for proxy.proxy_http2
: HTTP2 support module for proxy.proxy_fcgi
: FastCGI support module for proxy.
Enabling required Apache2 HTTPS server modules for Drupal 11,10,9:
sudo a2enmod expires
sudo a2enmod headers
Enable required Apache2 HTTP modules for Drupal.
Commands needed to be executed in a sequence.

Suggested a web server reboot, so new changes will take effect.
Enabling remaining Apache2 modules are optional, depending on the needs and specific of your Drupal configuration. Keep in mind, that amount of enabled modules are affect general performance of the web server, so best strategy is to enable only needed ones.
#or
sudo apachectl -M
Command to show all enabled Apache2 HTTP server modules.
Conclusion:
Enabling the all required Apache2 modules for Drupal ensures smooth functionality, best performance of your website. Using commands like a2enmod
and restarting Apache (systemctl restart apache2
), you can easily manage these modules on Ubuntu like systems.
Remember to always verify module activation using apachectl -M
and check Drupal’s documentation for more information.