Role that installs apache https://httpd.apache.org
Go to file
Andrea Dell'Amico 2ec983c1da defaults: one apache_* namespace for both families
The collection had two roles for the same service: this one, deb only, and an EL
only 'httpd' role in a library that is no longer maintained.

The namespace is apache_*. The httpd_* names are gone rather than aliased: an
alias that silently stops matching is the failure mode this merge is meant to
remove. httpd_main_packages becomes apache_packages, httpd_ssl_enabled becomes
apache_ssl_modules_enabled, everything else is a mechanical rename.

Packages, service name, config directory, user and group carry the distribution
test inside the default itself, the convention already used by the postgresql
role, so they stay overridable from host_vars and group_vars. The package list
uses a single Jinja expression rather than an {% if %} block, which would render
the list as its repr.

apache_servertokens keeps the value the absorbed role used, OS, rather than the
safer Prod: changing it here would be a silent change for every host that
inherits the default.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018sTDubHhviDWKZLtAtZXTW
2026-09-04 19:54:37 +00:00
defaults defaults: one apache_* namespace for both families 2026-09-04 19:54:37 +00:00
files Change the letsencrypt env path 2023-03-24 14:42:27 +01:00
handlers Import the old role. 2020-06-02 15:48:56 +02:00
meta Import the old role. 2020-06-02 15:48:56 +02:00
tasks Fix a typo. 2023-11-15 16:51:54 +01:00
templates Import the old role. 2020-06-02 15:48:56 +02:00
tests Initial commit 2020-05-28 14:54:59 +02:00
vars Initial commit 2020-05-28 14:54:59 +02:00
.gitignore Initial commit 2020-05-28 14:54:59 +02:00
LICENSE Initial commit 2020-05-28 14:54:59 +02:00
README.md Import the old role. 2020-06-02 15:48:56 +02:00

README.md

Role Name

A role that installs and configures the apache web server http://httpd.apache.org

Role Variables

The most important variables are listed below:

apache_service_enabled: True
apache_user: www-data
apache_pkg_state: latest
apache_group: '{{ apache_user }}'
apache_from_ppa: False
apache_ppa_repo: 'ppa:ondrej/apache2'

apache_listen_ports:
  - 80
  - '{{ apache_ssl_port }}'

# Possible choices: event, prefork (the old ones), worker (the threaded version), itm
apache_mpm_mode: worker

apache_packages:
  - apache2
  - apache2-utils
  - libapache2-mod-xsendfile
  - unzip
  - zip

apache_modules_packages:
  - 'apache2-mpm-{{ apache_mpm_mode }}'

# Only one can be present at the same time. It needs to be listed as the last one
apache_worker_modules:
#  - { name: 'mpm_itm', state: 'absent' }
  - { name: 'mpm_event', state: 'absent' }
  - { name: 'mpm_prefork', state: 'absent' }
  - { name: 'mpm_{{ apache_mpm_mode }}', state: 'present' }

# apache RPAF is needed to obtain the real client addresses when behind a reverse proxy
apache_rpaf_install: False

apache_default_modules:
  - headers
  - rewrite
  - expires
  - xsendfile

apache_ssl_modules_enabled: True
apache_ssl_port: 443
apache_ssl_modules:
  - ssl
  - socache_shmcb
apache_http_proxy_modules_enabled: False
apache_http_proxy_modules:
  - proxy
  - proxy_ajp
  - proxy_http

apache_status_module: True  
apache_status_location: '/server-status'
apache_status_allowed_hosts:
  - 127.0.0.1/8

apache_info_module: True
apache_info_location: '/server-info'
apache_info_allowed_hosts:
  - 127.0.0.1/8

apache_basic_auth: False
apache_basic_auth_single_file: True
apache_basic_auth_dir: /etc/apache2/auth
apache_basic_auth_file: '{{ apache_basic_auth_dir }}/htpasswd'

apache_basic_auth_modules:
  - auth_basic
  - authn_file
  - authz_user

# Put them in a vault file. auth_file is optional. Not used when apache_basic_auth_single_file is true
apache_basic_users:
  - { username:'', password:'', state:'present,absent', auth_file:'path_to_file' }

#
apache_additional_packages: False
apache_additional_packages_list:
#   - libapache2-mod-uwsgi
#   - ...
#
# Set this variable to load the modules you need
apache_additional_modules: False
apache_additional_modules_list: []
#  -
#  -

apache_letsencrypt_managed: True
apache_letsencrypt_proxy_modules:
  - proxy
  - proxy_http

apache_letsencrypt_proxy_conf:
  - letsencrypt-proxy.conf

Dependencies

None

License

EUPL-1.2

Author Information

Andrea DellAmico, andrea.dellamico@isti.cnr.it