{"id":19402136,"url":"https://github.com/robertdebock/ansible-role-httpd","last_synced_at":"2025-10-05T00:09:44.746Z","repository":{"id":26973966,"uuid":"110265290","full_name":"robertdebock/ansible-role-httpd","owner":"robertdebock","description":"Install and configure httpd on your system.","archived":false,"fork":false,"pushed_at":"2025-09-02T10:58:39.000Z","size":461,"stargazers_count":11,"open_issues_count":6,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-29T14:56:29.750Z","etag":null,"topics":["ansible","apache","httpd","installer","molecule","networking","package","playbook","system","tox","webserver"],"latest_commit_sha":null,"homepage":"https://robertdebock.nl/","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdebock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"robertdebock"}},"created_at":"2017-11-10T15:58:13.000Z","updated_at":"2025-09-02T10:58:43.000Z","dependencies_parsed_at":"2024-01-02T09:36:04.513Z","dependency_job_id":"8dc404e3-809c-4fc2-978c-005e68e313b9","html_url":"https://github.com/robertdebock/ansible-role-httpd","commit_stats":null,"previous_names":[],"tags_count":95,"template":false,"template_full_name":null,"purl":"pkg:github/robertdebock/ansible-role-httpd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-httpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-httpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-httpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-httpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdebock","download_url":"https://codeload.github.com/robertdebock/ansible-role-httpd/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fansible-role-httpd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278391291,"owners_count":25978962,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","apache","httpd","installer","molecule","networking","package","playbook","system","tox","webserver"],"created_at":"2024-11-10T11:22:02.474Z","updated_at":"2025-10-05T00:09:44.740Z","avatar_url":"https://github.com/robertdebock.png","language":"Jinja","funding_links":["https://github.com/sponsors/robertdebock"],"categories":[],"sub_categories":[],"readme":"# [Ansible role httpd](#httpd)\n\nInstall and configure httpd on your system.\n\n|GitHub|GitLab|Downloads|Version|\n|------|------|---------|-------|\n|[![github](https://github.com/robertdebock/ansible-role-httpd/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-httpd/actions)|[![gitlab](https://gitlab.com/robertdebock-iac/ansible-role-httpd/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-httpd)|[![downloads](https://img.shields.io/ansible/role/d/robertdebock/httpd)](https://galaxy.ansible.com/robertdebock/httpd)|[![Version](https://img.shields.io/github/release/robertdebock/ansible-role-httpd.svg)](https://github.com/robertdebock/ansible-role-httpd/releases/)|\n\n## [Example Playbook](#example-playbook)\n\nThis example is taken from [`molecule/default/converge.yml`](https://github.com/robertdebock/ansible-role-httpd/blob/master/molecule/default/converge.yml) and is tested on each push, pull request and release.\n\n```yaml\n---\n- name: Converge\n  hosts: all\n  become: true\n  gather_facts: true\n\n  vars_files:\n    - ../../vars/main.yml\n    - ../../defaults/main.yml\n\n  roles:\n    - role: robertdebock.httpd\n      # https_ssl_enable: true\n      httpd_port: 8080\n      httpd_ssl_port: 8443\n      httpd_locations:\n        - name: my_location\n          location: /my_location\n          backend_url: \"http://localhost:8080/myapplication\"\n      httpd_vhosts:\n        - name: redirect_to_https\n          servername: www.example.com\n          port: 8080\n          redirect_to_https: true\n          ssl_port: 8443\n      # httpd_vhosts:\n      #   - name: my_vhost_docroot\n      #     servername: www1.example.com\n      #     documentroot: \"{{ httpd_data_directory }}/www1.example.com\"\n      #   - name: my_vhost_backend_http\n      #     servername: www2.example.com\n      #     backend_url: \"http://www.example.com/\"\n      #     serveralias:\n      #       - example.com\n      #       - www.example.com\n      #   - name: my_vhost_remote\n      #     servername: www3.example.com\n      #     remote: \"http://localhost:3128/\"\n      #   - name: my_vhost_backend_https\n      #     servername: www4.example.com\n      #     backend_url: \"https://www.example.com/\"\n      #   - name: my_vhost_piratebay\n      #     servername: piratebay.nl\n      #     backend_url: \"https://thepirate-bay.org/\"\n      #     proxy_preserve_host: Off\n      #     proxy_requests: Off\n      #     setenv:\n      #       - name: force-proxy-request-1.0\n      #         value: 1\n      #       - name: proxy-nokeepalive\n      #         value: 1\n      #       - name: proxy-initial-not-pooled\n      #       - name: proxy-sendchunks\n      #         value: 1\n      #   - name: no_doc_root\n      #     servername: nodocroot.example.com\n      #     documentroot: /var/www/html/nodocroot\n      #     create_docroot: false\n      #   - name: my_vhost_with_locations\n      #     servername: my_vhost_with_locations.example.com\n      #     locations:\n      #       - location: /my_location\n      #         backend_url: \"http://localhost:8080/myapplication\"\n      #       - location: /my_location2\n      #         backend_url: \"http://localhost:8080/myapplication2\"\n      #   - name: my_https_vhost_with_locations\n      #     port: 8443\n      #     servername: my_vhost_with_locations.example.com\n      #     ssl_certificate_file: \"{{ httpd_ssl_certificate_file }}\"\n      #     ssl_certificate_key_file: \"{{ httpd_ssl_certificate_key_file }}\"\n      #     locations:\n      #       - location: /my_location\n      #         backend_url: \"http://localhost:8080/myapplication\"\n      #       - location: /my_location2\n      #         backend_url: \"http://localhost:8080/myapplication2\"\n      #   - name: my_vhost_with_error_log\n      #     servername: my_vhost_with_error_log.example.com\n      #     error_log: /var/log/httpd/my_vhost_with_error_log.example.com-error.log\n      #   - name: my_vhost_with_custom_log\n      #     servername: my_vhost_with_custom_log.example.com\n      #     custom_log: /var/log/httpd/my_vhost_with_custom_log.example.com-access.log combined\n      #   - name: my_vhost_with_error_log_and_custom_log\n      #     servername: my_vhost_with_error_log_and_custom_log.example.com\n      #     error_log: /var/log/httpd/my_vhost_with_error_log_and_custom_log.example.com-error.log\n      #     custom_log: /var/log/httpd/my_vhost_with_error_log_and_custom_log.example.com-access.log combined\n      #   - name: my_vhost_with_directory\n      #     servername: my_vhost_with_directory.example.com\n      #     directories:\n      #       - path: \"{{ httpd_data_directory }}/my_vhost_with_directory\"\n      #         options:\n      #           - Indexes\n      #           - FollowSymLinks\n      #         allow_override: All\n      #         require: all granted\n\n      httpd_directories:\n        - name: my_directory\n          path: \"{{ httpd_data_directory }}/my_directory\"\n          options:\n            - Indexes\n            - FollowSymLinks\n          allow_override: All\n          require: all granted\n```\n\nThe machine needs to be prepared. In CI this is done using [`molecule/default/prepare.yml`](https://github.com/robertdebock/ansible-role-httpd/blob/master/molecule/default/prepare.yml):\n\n```yaml\n---\n- name: Prepare\n  hosts: all\n  become: true\n  gather_facts: false\n\n  roles:\n    - role: robertdebock.bootstrap\n    - role: robertdebock.epel\n    - role: robertdebock.buildtools\n    - role: robertdebock.python_pip\n      python_pip_update: false\n    - role: robertdebock.openssl\n      openssl_items:\n        - name: apache-httpd\n          common_name: \"{{ ansible_fqdn }}\"\n```\n\nAlso see a [full explanation and example](https://robertdebock.nl/how-to-use-these-roles.html) on how to use these roles.\n\n## [Role Variables](#role-variables)\n\nThe default values for the variables are set in [`defaults/main.yml`](https://github.com/robertdebock/ansible-role-httpd/blob/master/defaults/main.yml):\n\n```yaml\n---\n# defaults file for httpd\n\n# The servername to use.\nhttpd_servername: \"{{ ansible_fqdn }}\"\n\n# The non-SSL port to use.\nhttpd_port: 80\n\n# Enable (self-signed certificates) SSL?\nhttps_ssl_enable: false\n\n# To configure https, set the hostname to listen to.\nhttpd_ssl_servername: \"{{ ansible_fqdn }}\"\n\n# For SSL a TCP port is required.\nhttpd_ssl_port: 443\n\n# SSL Certificate:\nhttpd_openssl_crt: \"{{ httpd_openssl_crt_directory }}/apache-httpd.crt\"\n\n# SSL Key\nhttpd_openssl_key: \"{{ httpd_openssl_key_directory }}/apache-httpd.key\"\n\n# If the \"it works\" page should be kept\nhttpd_remove_example: false\n\n# Additionnal httpd module to install\n\nhttpd_additionnal_modules: []\n\nhttpd_custom_modules_to_activate_with_command: []\n\napache_global_vhost_settings: |\n  DirectoryIndex index.php index.html\n\n# Template to uses for vhosts. Usefull to override the conf by your own setup.\nvhost_conf_template: vhost.conf.j2\n\ndefault_vhost_conf: default_vhost.conf\n```\n\n## [Requirements](#requirements)\n\n- pip packages listed in [requirements.txt](https://github.com/robertdebock/ansible-role-httpd/blob/master/requirements.txt).\n\n## [State of used roles](#state-of-used-roles)\n\nThe following roles are used to prepare a system. You can prepare your system in another way.\n\n| Requirement | GitHub | GitLab |\n|-------------|--------|--------|\n|[robertdebock.bootstrap](https://galaxy.ansible.com/robertdebock/bootstrap)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-bootstrap/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-bootstrap/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-bootstrap/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-bootstrap)|\n|[robertdebock.buildtools](https://galaxy.ansible.com/robertdebock/buildtools)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-buildtools/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-buildtools/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-buildtools/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-buildtools)|\n|[robertdebock.epel](https://galaxy.ansible.com/robertdebock/epel)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-epel/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-epel/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-epel/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-epel)|\n|[robertdebock.openssl](https://galaxy.ansible.com/robertdebock/openssl)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-openssl/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-openssl/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-openssl/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-openssl)|\n|[robertdebock.python_pip](https://galaxy.ansible.com/robertdebock/python_pip)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-python_pip/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-python_pip/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-python_pip/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-python_pip)|\n|[robertdebock.selinux](https://galaxy.ansible.com/robertdebock/selinux)|[![Build Status GitHub](https://github.com/robertdebock/ansible-role-selinux/workflows/Ansible%20Molecule/badge.svg)](https://github.com/robertdebock/ansible-role-selinux/actions)|[![Build Status GitLab](https://gitlab.com/robertdebock-iac/ansible-role-selinux/badges/master/pipeline.svg)](https://gitlab.com/robertdebock-iac/ansible-role-selinux)|\n\n## [Context](#context)\n\nThis role is a part of many compatible roles. Have a look at [the documentation of these roles](https://robertdebock.nl/) for further information.\n\nHere is an overview of related roles:\n![dependencies](https://raw.githubusercontent.com/robertdebock/ansible-role-httpd/png/requirements.png \"Dependencies\")\n\n## [Compatibility](#compatibility)\n\nThis role has been tested on these [container images](https://hub.docker.com/u/robertdebock):\n\n|container|tags|\n|---------|----|\n|[EL](https://hub.docker.com/r/robertdebock/enterpriselinux)|9|\n|[Debian](https://hub.docker.com/r/robertdebock/debian)|all|\n|[Fedora](https://hub.docker.com/r/robertdebock/fedora)|all|\n|[Ubuntu](https://hub.docker.com/r/robertdebock/ubuntu)|all|\n\nThe minimum version of Ansible required is 2.12, tests have been done to:\n\n- The previous version.\n- The current version.\n- The development version.\n\nIf you find issues, please register them in [GitHub](https://github.com/robertdebock/ansible-role-httpd/issues).\n\n## [License](#license)\n\n[Apache-2.0](https://github.com/robertdebock/ansible-role-httpd/blob/master/LICENSE).\n\n## [Author Information](#author-information)\n\n[robertdebock](https://robertdebock.nl/)\n\nPlease consider [sponsoring me](https://github.com/sponsors/robertdebock).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fansible-role-httpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdebock%2Fansible-role-httpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fansible-role-httpd/lists"}