{"id":19871928,"url":"https://github.com/saltstack-formulas/apache-formula","last_synced_at":"2025-06-10T09:03:35.503Z","repository":{"id":8924424,"uuid":"10653385","full_name":"saltstack-formulas/apache-formula","owner":"saltstack-formulas","description":"Set up and configure the Apache HTTP server","archived":false,"fork":false,"pushed_at":"2025-04-07T20:00:54.000Z","size":1491,"stargazers_count":50,"open_issues_count":31,"forks_count":283,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-06-10T09:03:13.849Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saltstack-formulas.png","metadata":{"files":{"readme":"docs/README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-06-12T22:05:03.000Z","updated_at":"2024-03-26T22:19:39.000Z","dependencies_parsed_at":"2025-06-10T09:03:16.022Z","dependency_job_id":null,"html_url":"https://github.com/saltstack-formulas/apache-formula","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fapache-formula","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fapache-formula/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fapache-formula/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fapache-formula/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saltstack-formulas","download_url":"https://codeload.github.com/saltstack-formulas/apache-formula/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saltstack-formulas%2Fapache-formula/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259043761,"owners_count":22797159,"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","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":[],"created_at":"2024-11-12T16:13:59.994Z","updated_at":"2025-06-10T09:03:35.478Z","avatar_url":"https://github.com/saltstack-formulas.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"apache\n======\n\n|img_travis| |img_sr|\n\n.. |img_travis| image:: https://travis-ci.com/saltstack-formulas/apache-formula.svg?branch=master\n   :alt: Travis CI Build Status\n   :scale: 100%\n   :target: https://travis-ci.com/saltstack-formulas/apache-formula\n.. |img_sr| image:: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n   :alt: Semantic Release\n   :scale: 100%\n   :target: https://github.com/semantic-release/semantic-release\n\nFormulas to set up and configure the Apache HTTP server on GNU/Linux, FreeBSD, and Windows OS.\n\n.. contents:: **Table of Contents**\n\nGeneral notes\n-------------\n\nSee the full `SaltStack Formulas installation and usage instructions\n\u003chttps://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html\u003e`_.\n\nIf you are interested in writing or contributing to formulas, please pay attention to the `Writing Formula Section\n\u003chttps://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#writing-formulas\u003e`_.\n\nIf you want to use this formula, please pay attention to the ``FORMULA`` file and/or ``git tag``,\nwhich contains the currently released version. This formula is versioned according to `Semantic Versioning \u003chttp://semver.org/\u003e`_.\n\nSee `Formula Versioning Section \u003chttps://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html#versioning\u003e`_ for more details.\n\nContributing to this repo\n-------------------------\n\n**Commit message formatting is significant!!**\n\nPlease see `How to contribute \u003chttps://github.com/saltstack-formulas/.github/blob/master/CONTRIBUTING.rst\u003e`_ for more details.\n\nAvailable states\n----------------\n\n.. contents::\n   :local:\n\n``apache``\n^^^^^^^^^^\n\nInstalls the Apache package and starts the service.\n\n``apache.config``\n^^^^^^^^^^^^^^^^^\n\nMetastate to apply all apache configuration\n\n\n``apache.config.file``\n^^^^^^^^^^^^^^^^^^^^^^\n\nConfigures apache based on os_family\n\n``apache.config.flags``\n^^^^^^^^^^^^^^^^^^^^^^^\n\nConfigures apache flags on SuSE\n\n``apache.config.certificates``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDeploy SSL certificates from pillars\n\n``apache.config.modules``\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nMetastate to Enable and disable Apache modules.\n\n``apache.config.modules.mod_mpm``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nConfigures the apache mpm modules on Debian ``mpm_prefork``, ``mpm_worker`` or ``mpm_event`` (Debian Only)\n\n``apache.config.modules.mod_rewrite``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnabled the Apache module mod_rewrite (Debian and FreeBSD only)\n\n``apache.config.modules.mod_proxy``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables the Apache module mod_proxy. (Debian and FreeBSD only)\n\n``apache.config.modules.mod_proxy_http``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables the Apache module mod_proxy_http and requires the Apache module mod_proxy to be enabled. (Debian Only)\n\n``apache.config.modules.mod_proxy_fcgi``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables the Apache module mod_proxy_fcgi and requires the Apache module mod_proxy to be enabled. (Debian Only)\n\n``apache.config.modules.mod_wsgi``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls the mod_wsgi package and enables the Apache module.\n\n``apache.config.modules.mod_actions``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables the Apache module mod_actions. (Debian Only)\n\n``apache.config.modules.mod_headers``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables the Apache module mod_headers. (Debian Only)\n\n``apache.config.modules.mod_pagespeed``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and Enables the mod_pagespeed module. (Debian and RedHat Only)\n\n``apache.config.modules.mod_perl2``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and enables the mod_perl2 module (Debian and FreeBSD only)\n\n``apache.config.modules.mod_geoip``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and enables the mod_geoIP (RedHat only)\n\n``apache.config.modules.mod_php5``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and enables the mod_php5 module\n\n``apache.config.modules.mod_cgi``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables mod_cgi. (FreeBSD only)\n\n``apache.config.modules.mod_fcgid``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and enables the mod_fcgid module (Debian only)\n\n``apache.config.modules.mod_fastcgi``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and enables the mod_fastcgi module\n\n``apache.config.modules.mod_dav_svn``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and enables the mod_dav_svn module (Debian only)\n\n``apache.config.modules.mod_security``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls an enables the `Apache mod_security2 WAF \u003chttp://modsecurity.org/\u003e`_\nusing data from Pillar. (Debian and RedHat Only)\n\nAllows you to install the basic Core Rules (CRS) and some basic configuration for mod_security2\n\n``apache.config.modules.mod_security.rules``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThis state can create symlinks based on basic Core Rules package. (Debian only)\nOr it can distribute a mod_security rule file and place it /etc/modsecurity/\n\n``apache.config.modules.mod_socache_shmcb``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables mod_socache_shmcb. (FreeBSD only)\n\n``apache.config.modules.mod_ssl``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and enables the mod_ssl module (Debian, RedHat and FreeBSD only)\n\n``apache.config.modules.mod_suexec``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables mod_suexec. (FreeBSD only)\n\n``apache.config.modules.mod_vhost_alias``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables the Apache module vhost_alias (Debian Only)\n\n``apache.config.modules.mod_remoteip``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEnables and configures the Apache module mod_remoteip using data from Pillar. (Debian Only)\n\n``apache.config.modules.mod_xsendfile``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and enables mod_xsendfile module. (Debian Only)\n\n``apache.config.own_default_vhost``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nReplace default vhost with own version. By default, it's 503 code. (Debian Only)\n\n``apache.config.no_default_vhost``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nRemove the default vhost. (Debian Only)\n\n``apache.config.vhosts.standard``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nConfigures Apache name-based virtual hosts and creates virtual host directories using data from Pillar.\n\nExample Pillar:\n\n.. code:: yaml\n\n    apache:\n      sites:\n        example.com: # must be unique; used as an ID declaration in Salt; also passed to the template context as {{ id }}\n          template_file: salt://apache/vhosts/standard.tmpl\n\nWhen using the provided templates, one can use a space separated list\nof interfaces to bind to. For example, to bind both IPv4 and IPv6:\n\t\n.. code:: yaml\n\n    apache:\n      sites:\n        example.com:\n          interface: '1.2.3.4 [2001:abc:def:100::3]'\n\t  \n``apache.config.manage_security``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nConfigures Apache's security.conf options by reassinging them using data from Pillar.\n\n``apache.config.modules.mod_status``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nConfigures Apache's server_status handler for localhost\n\n``apache.config.debian_full``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstalls and configures Apache on Debian and Ubuntu systems.\n\n``apache.config.clean``\n^^^^^^^^^^^^^^^^^^^^^^^\n\nMetastate to cleanup all apache configuration.\n\n\n``apache.clean``\n^^^^^^^^^^^^^^^^\n\nStops the Apache service and uninstalls the package.\n\nThese states are ordered using the ``order`` declaration. Different stages\nare divided into the following number ranges:\n\n1)  apache will use 1-500 for ordering\n2)  apache will reserve 1  -100 as unused\n3)  apache will reserve 101-150 for pre pkg install\n4)  apache will reserve 151-200 for pkg install\n5)  apache will reserve 201-250 for pkg configure\n6)  apache will reserve 251-300 for downloads, git stuff, load data\n7)  apache will reserve 301-400 for unknown purposes\n8)  apache will reserve 401-450 for service restart-reloads\n9)  apache WILL reserve 451-460 for service.running\n10) apache will reserve 461-500 for cmd requiring operational services\n\nExample Pillar:\n\n.. code:: yaml\n\n    apache:\n      register-site:\n        # any name as an array index, and you can duplicate this section\n        {{UNIQUE}}:\n          name: 'my name'\n          path: 'salt://path/to/sites-available/conf/file'\n          state: 'enabled'\n\n      sites:\n        # Force SSL: Redirect from 80 to 443\n        example.com:\n          port: 80\n          template_file: salt://apache/vhosts/redirect.tmpl\n          RedirectSource: 'permanent /'\n          # Trailing slash is important\n          RedirectTarget: 'https://example.com/'\n        example.com_ssl:\n          port: 443\n          ServerName: example.com\n          SSLCertificateFile: /path/to/ssl.crt\n          SSLCertificateKeyFile: /path/to/ssl.key\n          SSLCertificateChainFile: /path/to/ssl.ca.crt\n\n``apache.config.vhosts.clean``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nRemove non-declared virtual hosts, and deactivates the service.\n\n``apache.config.vhosts.cleanup``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nRemove non-declared virtual hosts, but keeps the service running.\n\n\nTesting\n-------\n\nLinux testing is done with ``kitchen-salt``.\n\nRequirements\n^^^^^^^^^^^^\n\n* Ruby\n* Docker\n\n.. code-block:: bash\n\n   $ gem install bundler\n   $ bundle install\n   $ bin/kitchen test [platform]\n\nWhere ``[platform]`` is the platform name defined in ``kitchen.yml``,\ne.g. ``debian-9-2019-2-py3``.\n\n``bin/kitchen converge``\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nCreates the docker instance and runs the ``apache`` main states, ready for testing.\n\n``bin/kitchen verify``\n^^^^^^^^^^^^^^^^^^^^^^\n\nRuns the ``inspec`` tests on the actual instance.\n\n``bin/kitchen destroy``\n^^^^^^^^^^^^^^^^^^^^^^^\n\nRemoves the docker instance.\n\n``bin/kitchen test``\n^^^^^^^^^^^^^^^^^^^^\n\nRuns all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.\n\n``bin/kitchen login``\n^^^^^^^^^^^^^^^^^^^^^\n\nGives you SSH access to the instance for manual testing.\n\nTesting with Vagrant\n--------------------\n\nWindows/FreeBSD/OpenBSD testing is done with ``kitchen-salt``.\n\nRequirements\n^^^^^^^^^^^^\n\n* Ruby\n* Virtualbox\n* Vagrant\n\nSetup\n^^^^^\n\n.. code-block:: bash\n\n   $ gem install bundler\n   $ bundle install --with=vagrant\n   $ bin/kitchen test [platform]\n\nWhere ``[platform]`` is the platform name defined in ``kitchen.vagrant.yml``,\ne.g. ``windows-81-latest-py3``.\n\nNote\n^^^^\n\nWhen testing using Vagrant you must set the environment variable ``KITCHEN_LOCAL_YAML`` to ``kitchen.vagrant.yml``.  For example:\n\n.. code-block:: bash\n\n   $ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test      # Alternatively,\n   $ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml\n   $ bin/kitchen test\n\nThen run the following commands as needed.\n\n``bin/kitchen converge``\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nCreates the Vagrant instance and runs the ``apache`` main states, ready for testing.\n\n``bin/kitchen verify``\n^^^^^^^^^^^^^^^^^^^^^^\n\nRuns the ``inspec`` tests on the actual instance.\n\n``bin/kitchen destroy``\n^^^^^^^^^^^^^^^^^^^^^^^\n\nRemoves the Vagrant instance.\n\n``bin/kitchen test``\n^^^^^^^^^^^^^^^^^^^^\n\nRuns all of the stages above in one go: i.e. ``destroy`` + ``converge`` + ``verify`` + ``destroy``.\n\n``bin/kitchen login``\n^^^^^^^^^^^^^^^^^^^^^\n\nGives you RDP/SSH access to the instance for manual testing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltstack-formulas%2Fapache-formula","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaltstack-formulas%2Fapache-formula","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaltstack-formulas%2Fapache-formula/lists"}