About Apache

Last modified: September 26, 2024


Overview

EasyApache 4 installs and manages the Apache® web server and all of its components. When you install cPanel & WHM, the installation process automatically runs EasyApache 4, which installs Apache with the basic requirements for a functional web server.

To modify your Apache configuration, use WHM’s EasyApache 4 interface (WHM » Home » Software » EasyApache 4).

Important:
The Apache Software Foundation develops the Apache HTTP Server Project, which provides the Apache web server software. For an introduction to the Apache web server, read Apache’s Getting Started documentation.

Apache versions

EasyApache 4 only supports Apache 2.4.

When Apache releases a new version, we test and update the EasyApache 4 packages. Minor version number changes do not impact functionality, but major updates may require changes to your configuration.

Apache configuration

The Apache configuration we provide includes the following components by default:

  • The core Apache modules — These include the modules necessary to perform the basic duties of a web server.
  • The most common Apache modules — These include the modules that most web servers use.
  • A Multi-Processing Module (MPM) — Our default Apache configuration uses MPM Prefork. The MPM that you select determines how Apache handles requests.
  • PHP — PHP versions 8.1 and 8.2 are included by default. For more information, read our About PHP documentation.

Apache file locations

The following table provides a list of the most common Apache file paths:

File path Description
/usr/sbin/httpd The Apache binary file.
/var/log/apache2/ This directory contains Apache log files.
/etc/apache2/ This directory contains Apache’s configuration directories for its includes, modules, and configuration files.
/etc/apache2/conf/httpd.conf The primary Apache configuration file.
/etc/apache2/conf.d/ The primary Apache configuration file directory.
/etc/apache2/conf.d/includes/ The directory that contains the include files that add content to the httpd.conf file.
You can modify these configuration files via the command line interface (CLI) or WHM’s Include Editor interface (WHM » Home » Service Configuration » Apache Configuration » Include Editor).
/usr/lib64/apache2/modules/ This directory contains all of the dynamic modules for Apache.
Some servers use the /usr/lib/apache2/modules/ directory instead.
/etc/apache2/logs/access_log This file contains HTTP requests that the server received and that did not go to a domain.
/etc/apache2/logs/domlogs/ This directory contains a log of HTTP requests that the system routed to a domain.
/etc/apache2/logs/error_log This file contains error information.
/var/www/html/ This directory contains the document root for the server. It contains default pages that users can see.
/etc/apache2/logs/ This directory contains an alias to the /var/log/apache2/ directory.
/etc/apache2/modules/ This directory contains an alias to the /usr/lib64/apache2/modules/ directory.

For more information about Apache configuration and file paths, read our Advanced Apache Configuration and Advanced Apache Configuration — The paths.conf documentation.

Apache modules

Default Apache modules

When you install cPanel & WHM, the system installs the cPanel Default EasyApache 4 profile. This profile provides the basic components for a web server.

The cPanel Default profile includes the following Apache modules by default:

Apache module Description
mod_cgi Handles CGI requests.
mod_deflate Compresses content before delivery to the client.
mod_expires Generates Expires and Cache-Control HTTP headers with user-specified criteria.
mod_headers  Customization of HTTP request and response headers.
mod_mpm_prefork Implements a non-threaded, pre-forking web server.
mod_proxy HTTP/1.1 proxy/gateway server.
mod_proxy_fcgi FastCGI proxy module for the Apache HTTP server.
mod_ruid2  Allows a domain’s HTTP requests to run as the owner of that domain.
For more information, read our Apache Module: Ruid2 documentation.
mod_security2 A web application firewall.
For more information, read our Apache Module: ModSecurity® documentation.
mod_ssl Handles security through the Secure Sockets Layer (SSL) and Transport Layer Security (TLS) protocols.
mod_unique_id Provides an environment variable with a unique identifier for each request.

Other available Apache modules

You can select other Apache modules in the Apache Modules section of WHM’s EasyApache 4 interface (WHM » Home » Software » EasyApache 4) when you customize a profile.

Apache module Description
mod_allowmethods Restrict which HTTP methods the server can use.
mod_asis As-is provider module for the Apache HTTP server.
mod_auth_digest HTTP Digest Authentication module for the Apache HTTP server.
mod_authn_anon Anonymous-user authentication module for the Apache HTTP server.
mod_authn_dbd DBD-based authentication module for the Apache HTTP server.
mod_authn_dbm DBM-based authentication module for the Apache HTTP server.
mod_authn_socache Shared-memory authentication caching module for the Apache HTTP server.
mod_authnz_ldap LDAP authentication/authorization module for the Apache HTTP server.
mod_authz_dbd DBD-based group authorization module for the Apache HTTP server.
mod_authz_dbm DBM-based group authorization module for the Apache HTTP server.
mod_authz_owner Ownership-based authorization module for the Apache HTTP server.
mod_buffer Request buffering module for the Apache HTTP server.
mod_brotli Compression module for the Apache HTTP server.
If you install this module, it applies to all virtual hosts. For more information, read our Apache Module: Brotli documentation.
mod_bw Bandwidth limitation options for the Apache HTTP server.
This module includes the /usr/local/cpanel/scripts/setbwlimit script to modify bandwidth limits. For more information, run the /usr/local/cpanel/scripts/setbwlimit —help command.
mod_cache Content caching module for the Apache HTTP server.
mod_cache_disk Disk-based caching module for the Apache HTTP server.
mod_cache_socache Shared-memory caching module for the Apache HTTP server.
mod_cgid CGI module for the Apache HTTP server.
mod_charset_lite Character-set conversion module for the Apache HTTP server.
mod_cpanel Improves how Apache processes requests.
mod_data RFC2379 data URL generation module for the Apache HTTP server.
mod_dav DAV module for the Apache HTTP server.
mod_dav_fs DAV filesystem provider module for the Apache HTTP server.
mod_dav_lock Generic DAV locking module for the Apache HTTP server.
mod_dbd Database connection module for the Apache HTTP server.
mod_dialup Bandwidth rate-limiting module for the Apache HTTP server.
mod_dumpio Debug logging module for the Apache HTTP server.
mod_env Environment variable module for the Apache HTTP server.
mod_evasive DoS, DDoS, and brute force attack protection for the Apache HTTP server.
For more information, read our Apache Module: Evasive documentation.
mod_ext_filter Generic filter module for the Apache HTTP server.
mod_file_cache Static file caching module for the Apache HTTP server.
mod_heartbeat Status reporting module for the Apache HTTP server.
mod_heartmonitor Heartbeat monitoring module for the Apache HTTP server.
mod_http2 The http2 module for the Apache HTTP server.
For more information, read our Apache Module: HTTP2 documentation.
mod_imagemap Server-side imagemap module for the Apache HTTP server.
mod_info Provides a comprehensive overview of server configuration. We do not recommend this module for shared servers.
mod_lbmethod_bybusyness Busyness load-balancing module for the Apache HTTP server.
mod_lbmethod_byrequests Request load-balancing module for the Apache HTTP server.
mod_lbmethod_bytraffic Traffic load-balancing module for the Apache HTTP server.
mod_lbmethod_heartbeat Heartbeat load-balancing module for the Apache HTTP server.
mod_ldap LDAP connection-handling module for the Apache HTTP server.
mod_log_debug Debug logging module for the Apache HTTP server.
mod_log_forensic Forensic logging module for the Apache HTTP server.
mod_lua The Lua language extension module for the Apache HTTP server.
We do not recommend this module for shared servers. For more information, read our Apache Module: Lua documentation.
mod_macro Configuration macro module for the Apache HTTP server.
mod_mime_magic MIME-type autosensing module for the Apache HTTP server.
mod-passenger The Phusion Passenger® package.
For more information, read our Using Passenger Applications documentation.
mod_pagespeed Improve web page latency.
mod_proxy_ajp Apache JServ Protocol 1.3 proxy module for the Apache HTTP server.
mod_proxy_balancer Load-balancing module for the Apache HTTP server.
mod_proxy_connect CONNECT HTTP method proxy module for the Apache HTTP server.
mod_proxy_express Dynamic reverse-proxy module for the Apache HTTP server.
mod_proxy_fdpass File descriptor-passing proxy module for the Apache HTTP server.
mod_proxy_ftp FTP proxy module for the Apache HTTP server.
mod_proxy_hcheck Dynamic health check of Balancer members (workers) for mod_proxy.
mod_proxy_html HTML and XML content filters for the Apache HTTP server.
mod_proxy_http HTTP/HTTPS proxy module for the Apache HTTP server.
mod_proxy_scgi SCGI module for the Apache HTTP server.
mod_proxy_uwsgi Websockets proxy support for the WSGWI protocol for the Apache HTTP server.
mod_proxy_wstunnel Websockets proxy module for the Apache HTTP server.
mod_qos Quality-of-service module for the Apache HTTP server.
mod_ratelimit Client bandwidth limiting module for the Apache HTTP server.
mod_reflector Filter-as-service module for the Apache HTTP server.
mod_remoteip IP address replacement module for the Apache HTTP server.
mod_reqtimeout Request timeout module for the Apache HTTP server.
mod_request Request body retention module for the Apache HTTP server.
mod_sed Regex replacement content filter module for the Apache HTTP server.
mod_session Session interface for the Apache HTTP server.
mod_slotmem_plain Slot-based memory module for the Apache HTTP server.
mod_socache_memcache Memcache-based object cache module for the Apache HTTP server.
mod_speling URL fallback module for the Apache HTTP server.
mod_substitute Response body substitution module for the Apache HTTP server.
mod_suexec Per-user/group execution module for the Apache HTTP server.
mod_suphp This module executes PHP scripts with the permissions of their owners.
mod_usertrack Cookie tracking module for the Apache HTTP server.
mod_version Version comparing module for the Apache HTTP server.
mod_vhost_alias Dynamic mass virtual hosting module for the Apache HTTP server.
mod_watchdog Periodic task module for the Apache HTTP server.

Apache security

EasyApache 4 provides a web application firewall, the ModSecurity® Apache module.

You must install and configure a ruleset with WHM’s ModSecurity® Configuration interface (WHM » Home » Security Center » ModSecurity® Configuration) to use ModSecurity. For more information about the ModSecurity Apache module, read our Apache Module: ModSecurity® documentation.

We strongly recommend that you read Apache’s Security Tips documentation.

Additional Documentation