@@ -55,6 +55,11 @@ Enables the Apache module mod_proxy. (Debian and FreeBSD only) | |||
Enables the Apache module mod_proxy_http and requires the Apache module mod_proxy to be enabled. (Debian Only) | |||
``apache.mod_proxy_fcgi`` | |||
------------------------- | |||
Enables the Apache module mod_proxy_fcgi and requires the Apache module mod_proxy to be enabled. (Debian Only) | |||
``apache.mod_wsgi`` | |||
------------------- | |||
@@ -100,6 +105,11 @@ Enables mod_cgi. (FreeBSD only) | |||
Installs and enables the mod_fcgid module | |||
``apache.mod_fastcgi`` | |||
-------------------- | |||
Installs and enables the mod_fastcgi module | |||
``apache.mod_dav_svn`` | |||
-------------------- | |||
@@ -144,6 +154,11 @@ Enables the Apache module vhost_alias (Debian Only) | |||
Enables and configures the Apache module mod_remoteip using data from Pillar. (Debian Only) | |||
``apache.mod_xsendfile`` | |||
---------------------- | |||
Installs and enables mod_xsendfile module. (Debian Only) | |||
``apache.own_default_vhost`` | |||
-------------------------- | |||
@@ -188,6 +203,11 @@ Configures Apache's security.conf options by reassinging them using data from Pi | |||
Installs and configures Apache on Debian and Ubuntu systems. | |||
``apache.uninstall`` | |||
---------- | |||
Stops the Apache service and uninstalls the package. | |||
These states are ordered using the ``order`` declaration. Different stages | |||
are divided into the following number ranges: | |||
@@ -17,6 +17,7 @@ include: | |||
{{ apache.vhostdir }}: | |||
file.directory: | |||
- makedirs: True | |||
- require: | |||
- pkg: apache | |||
- watch_in: |
@@ -35,6 +35,8 @@ | |||
'mod_perl2': 'libapache2-mod-perl2', | |||
'mod_fcgid': 'libapache2-mod-fcgid', | |||
'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb', | |||
'mod_xsendfile': 'libapache2-mod-xsendfile', | |||
'mod_fastcgi': 'libapache2-mod-fastcgi', | |||
'vhostdir': '/etc/apache2/sites-available', | |||
'confdir': '/etc/apache2/conf.d', | |||
@@ -54,6 +56,7 @@ | |||
'configfile': '/etc/httpd/conf/httpd.conf', | |||
'mod_wsgi': 'mod_wsgi', | |||
'conf_mod_wsgi': '/etc/httpd/conf.d/wsgi.conf', | |||
'mod_php5': 'php', | |||
'mod_pagespeed_source': 'https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm', | |||
@@ -0,0 +1,32 @@ | |||
{% from "apache/map.jinja" import apache with context %} | |||
include: | |||
- apache | |||
- apache.mod_actions | |||
{% if grains['os_family']=="Debian" %} | |||
mod-fastcgi: | |||
pkg.installed: | |||
- name: {{ apache.mod_fastcgi }} | |||
- order: 180 | |||
- require: | |||
- pkgrepo: repo-fastcgi | |||
- pkg: apache | |||
repo-fastcgi: | |||
pkgrepo.managed: | |||
- name: "deb http://httpredir.debian.org/debian jessie" | |||
- file: /etc/apt/sources.list.d/non-free.list | |||
- comps: non-free | |||
a2enmod fastcgi: | |||
cmd.run: | |||
- unless: ls /etc/apache2/mods-enabled/fastcgi.load | |||
- order: 225 | |||
- require: | |||
- pkg: mod-fastcgi | |||
- watch_in: | |||
- module: apache-restart | |||
{% endif %} | |||
@@ -0,0 +1,17 @@ | |||
{% if grains['os_family']=="Debian" %} | |||
include: | |||
- apache | |||
- apache.mod_proxy | |||
a2enmod proxy_fcgi: | |||
cmd.run: | |||
- unless: ls /etc/apache2/mods-enabled/proxy_fcgi.load | |||
- order: 225 | |||
- require: | |||
- pkg: apache | |||
- cmd: a2enmod proxy | |||
- watch_in: | |||
- module: apache-restart | |||
{% endif %} |
@@ -9,10 +9,11 @@ mod_wsgi: | |||
- require: | |||
- pkg: apache | |||
{% if grains.get('os_family') == 'RedHat' %} | |||
/etc/httpd/conf.d/wsgi.conf: | |||
{% if apache.conf_mod_wsgi %} | |||
{{ apache.conf_mod_wsgi }}: | |||
file.uncomment: | |||
- regex: LoadModule | |||
- onlyif: test -f {{ apache.conf_mod_wsgi }} | |||
- require: | |||
- pkg: mod_wsgi | |||
{% endif %} |
@@ -0,0 +1,24 @@ | |||
{% from "apache/map.jinja" import apache with context %} | |||
include: | |||
- apache | |||
mod-xsendfile: | |||
pkg.installed: | |||
- name: {{ apache.mod_xsendfile }} | |||
- order: 180 | |||
- require: | |||
- pkg: apache | |||
{% if grains['os_family']=="Debian" %} | |||
a2enmod xsendfile: | |||
cmd.run: | |||
- order: 225 | |||
- unless: ls /etc/apache2/mods-enabled/xsendfile.load | |||
- require: | |||
- pkg: mod-xsendfile | |||
- watch_in: | |||
- module: apache-restart | |||
{% endif %} | |||
@@ -6,10 +6,11 @@ Red Hat Enterprise Linux Server-6: | |||
version: '2.2' | |||
Red Hat Enterprise Linux Server-7: | |||
version: '2.4' | |||
CentOS Linux-6: | |||
CentOS-6: | |||
version: '2.2' | |||
CentOS Linux-7: | |||
version: '2.4' | |||
conf_mod_wsgi: '/etc/httpd/conf.modules.d/10-wsgi.conf' | |||
Oracle Linux Server-6: | |||
version: '2.2' | |||
Oracle Linux Server-7: |
@@ -0,0 +1,30 @@ | |||
{# Define default values here so the template below can just focus on layout #} | |||
{%- set sitename = site.get('ServerName', id) -%} | |||
{%- set vals = { | |||
'interfaces': site.get('interface', '*').split(), | |||
'port': site.get('port', '80'), | |||
'ServerName': sitename, | |||
'ServerAlias': site.get('ServerAlias', 'www.{0}'.format(sitename)), | |||
'ServerAdmin': site.get('ServerAdmin', 'webmaster@{0}'.format(sitename)), | |||
'LogLevel': site.get('LogLevel', 'warn'), | |||
'ErrorLog': site.get('ErrorLog', '{0}/{1}-error.log'.format(map.logdir, sitename)), | |||
'CustomLog': site.get('CustomLog', '{0}/{1}-access.log'.format(map.logdir, sitename)), | |||
'DocumentRoot': site.get('DocumentRoot', '{0}/{1}'.format(map.wwwdir, sitename)) | |||
} -%} | |||
<VirtualHost {% for intf in vals.interfaces %} {{intf}}:{{ vals.port }}{% endfor -%}> | |||
ServerName {{ vals.ServerName }} | |||
{% if site.get('ServerAlias') != False %}ServerAlias {{ vals.ServerAlias }}{% endif %} | |||
{% if site.get('ServerAdmin') != False %}ServerAdmin {{ vals.ServerAdmin }}{% endif %} | |||
{% if site.get('DocumentRoot') != False -%}DocumentRoot {{ vals.DocumentRoot }}{% endif %} | |||
{% if site.get('LogLevel') != False -%}LogLevel {{ vals.LogLevel }}{% endif %} | |||
{% if site.get('ErrorLog') != False -%}ErrorLog {{ vals.ErrorLog }}{% endif %} | |||
{% if site.get('CustomLog') != False -%}CustomLog {{ vals.CustomLog }} {{ vals.LogFormat }}{% endif %} | |||
</VirtualHost> |
@@ -41,7 +41,7 @@ apache: | |||
example.com: # must be unique; used as an ID declaration in Salt. | |||
enabled: True | |||
template_file: salt://apache/vhosts/standard.tmpl # or redirect.tmpl or proxy.tmpl | |||
template_file: salt://apache/vhosts/standard.tmpl # or minimal.tmpl or redirect.tmpl or proxy.tmpl | |||
####################### DEFAULT VALUES BELOW ############################ | |||
# NOTE: the values below are simply default settings that *can* be |