2013-08-23 05:14:28 +02:00
|
|
|
# ``apache`` formula configuration:
|
|
|
|
apache:
|
2013-08-28 00:27:01 +02:00
|
|
|
|
2015-08-26 14:05:25 +02:00
|
|
|
# lookup section overrides ``map.jinja`` values
|
|
|
|
lookup:
|
|
|
|
server: apache2
|
|
|
|
service: apache2
|
2013-08-28 00:27:01 +02:00
|
|
|
|
2015-08-26 14:05:25 +02:00
|
|
|
vhostdir: /etc/apache2/sites-available
|
|
|
|
confdir: /etc/apache2/conf.d
|
|
|
|
confext: .conf
|
|
|
|
logdir: /var/log/apache2
|
|
|
|
wwwdir: /srv/apache2
|
2015-08-25 21:38:16 +02:00
|
|
|
|
|
|
|
# apache version (generally '2.2' or '2.4')
|
|
|
|
version: '2.2'
|
2015-08-26 14:05:25 +02:00
|
|
|
|
|
|
|
# ``apache.mod_wsgi`` formula additional configuration:
|
|
|
|
mod_wsgi: mod_wsgi
|
2013-08-13 23:12:57 +02:00
|
|
|
|
2014-06-18 21:38:02 +02:00
|
|
|
# ``apache.vhosts`` formula additional configuration:
|
2013-08-28 00:27:01 +02:00
|
|
|
sites:
|
2014-06-18 21:48:28 +02:00
|
|
|
example.net:
|
|
|
|
template_file: salt://apache/vhosts/minimal.tmpl
|
|
|
|
|
|
|
|
example.com: # must be unique; used as an ID declaration in Salt.
|
2015-08-25 07:50:58 +02:00
|
|
|
enabled: True
|
2015-02-15 00:06:44 +01:00
|
|
|
template_file: salt://apache/vhosts/standard.tmpl # or redirect.tmpl or proxy.tmpl
|
2014-06-18 21:48:28 +02:00
|
|
|
|
|
|
|
####################### DEFAULT VALUES BELOW ############################
|
|
|
|
# NOTE: the values below are simply default settings that *can* be
|
|
|
|
# overridden and are not required in order to use this formula to create
|
|
|
|
# vhost entries.
|
|
|
|
#
|
|
|
|
# Do not copy the values below into your Pillar unless you intend to
|
|
|
|
# modify these vaules.
|
|
|
|
####################### DEFAULT VALUES BELOW ############################
|
2013-08-28 00:27:01 +02:00
|
|
|
template_engine: jinja
|
|
|
|
|
|
|
|
interface: '*'
|
|
|
|
port: '80'
|
|
|
|
|
2014-06-18 21:48:28 +02:00
|
|
|
ServerName: example.com # uses the unique ID above unless specified
|
|
|
|
ServerAlias: www.example.com
|
2013-08-28 00:27:01 +02:00
|
|
|
|
2014-06-18 21:48:28 +02:00
|
|
|
ServerAdmin: webmaster@example.com
|
2013-08-28 00:27:01 +02:00
|
|
|
|
|
|
|
LogLevel: warn
|
2014-06-18 21:48:28 +02:00
|
|
|
ErrorLog: /path/to/logs/example.com-error.log # E.g.: /var/log/apache2/example.com-error.log
|
|
|
|
CustomLog: /path/to/logs/example.com-access.log # E.g.: /var/log/apache2/example.com-access.log
|
2013-08-28 00:27:01 +02:00
|
|
|
|
2014-06-18 21:48:28 +02:00
|
|
|
DocumentRoot: /path/to/www/dir/example.com # E.g., /var/www/example.com
|
2013-08-28 00:27:01 +02:00
|
|
|
|
2015-05-14 04:38:27 +02:00
|
|
|
SSLCertificateFile: /etc/ssl/mycert.pem # if ssl is desired
|
|
|
|
SSLCertificateKeyFile: /etc/ssl/mycert.pem.key # if key for cert is needed or in an extra file
|
2015-06-09 11:54:07 +02:00
|
|
|
SSLCertificateChainFile: /etc/ssl/mycert.chain.pem # if you require a chain of server certificates file
|
2015-04-02 14:23:21 +02:00
|
|
|
|
2013-08-28 00:27:01 +02:00
|
|
|
Directory:
|
2014-06-18 21:48:28 +02:00
|
|
|
# "default" is a special case; Adds ``/path/to/www/dir/example.com``
|
|
|
|
# E.g.: /var/www/example.com
|
|
|
|
default:
|
2013-08-28 00:27:01 +02:00
|
|
|
Options: -Indexes FollowSymLinks
|
2014-10-01 10:35:53 +02:00
|
|
|
Order: allow,deny # For Apache < 2.4
|
|
|
|
Allow: from all # For apache < 2.4
|
|
|
|
Require: all granted # For apache > 2.4.
|
2013-08-28 00:27:01 +02:00
|
|
|
AllowOverride: None
|
|
|
|
Formula_Append: |
|
|
|
|
Additional config as a
|
|
|
|
multi-line string here
|
|
|
|
|
2015-02-15 00:12:13 +01:00
|
|
|
# if template is 'redirect.tmpl'
|
|
|
|
# RedirectSource: '/'
|
|
|
|
# RedirectTarget: 'http://www.example.net'
|
|
|
|
|
|
|
|
# if template is 'proxy.tmpl'
|
|
|
|
# ProxyPreserveHost: 'On'
|
2015-03-11 18:28:11 +01:00
|
|
|
# ProxyRoute:
|
|
|
|
# my sample route:
|
|
|
|
# ProxyPassSource: '/'
|
|
|
|
# ProxyPassTarget: 'http://www.example.net'
|
|
|
|
# ProxyPassReverseSource: '/'
|
|
|
|
# ProxyPassReverseTarget: 'http://www.example.net'
|
2015-02-15 00:12:13 +01:00
|
|
|
|
2015-12-09 06:48:08 +01:00
|
|
|
Alias:
|
|
|
|
/docs: /usr/share/docs
|
|
|
|
|
|
|
|
Location:
|
|
|
|
/docs:
|
|
|
|
Order: allow,deny # For Apache < 2.4
|
|
|
|
Allow: from all # For apache < 2.4
|
|
|
|
Require: all granted # For apache > 2.4.
|
|
|
|
Formula_Append: |
|
|
|
|
Additional config as a
|
|
|
|
multi-line string here
|
|
|
|
|
2013-08-28 00:27:01 +02:00
|
|
|
Formula_Append: |
|
|
|
|
Additional config as a
|
|
|
|
multi-line string here
|
|
|
|
|
2014-06-18 21:38:02 +02:00
|
|
|
# ``apache.debian_full`` formula additional configuration:
|
2013-08-13 23:12:57 +02:00
|
|
|
register-site:
|
|
|
|
# any name as an array index, and you can duplicate this section
|
2014-06-18 21:48:28 +02:00
|
|
|
UNIQUE_VALUE_HERE:
|
2013-08-13 23:12:57 +02:00
|
|
|
name: 'my name'
|
|
|
|
path: 'salt://path/to/sites-available/conf/file'
|
|
|
|
state: 'enabled'
|
2015-03-18 18:36:19 +01:00
|
|
|
# Optional - use managed file as Jinja Template
|
|
|
|
#template: true
|
|
|
|
#defaults:
|
|
|
|
# custom_var: "default value"
|
2014-11-21 00:37:14 +01:00
|
|
|
|
|
|
|
modules:
|
|
|
|
enabled: # List modules to enable
|
|
|
|
- ldap
|
|
|
|
- ssl
|
|
|
|
disabled: # List modules to disable
|
|
|
|
- rewrite
|
2015-12-14 15:12:20 +01:00
|
|
|
|
2015-12-17 00:40:48 +01:00
|
|
|
# KeepAlive: Whether or not to allow persistent connections (more than
|
|
|
|
# one request per connection). Set to "Off" to deactivate.
|
|
|
|
keepalive: On
|
|
|
|
|
2015-12-14 15:12:20 +01:00
|
|
|
security:
|
|
|
|
# can be Full | OS | Minimal | Minor | Major | Prod
|
|
|
|
# where Full conveys the most information, and Prod the least.
|
|
|
|
ServerTokens: Prod
|
2015-12-16 01:09:48 +01:00
|
|
|
|
|
|
|
# ``apache.mod_remoteip`` formula additional configuration:
|
|
|
|
mod_remoteip:
|
|
|
|
RemoteIPHeader: X-Forwarded-For
|
|
|
|
RemoteIPTrustedProxy:
|
|
|
|
- 10.0.8.0/24
|
2015-12-16 14:42:59 +01:00
|
|
|
- 127.0.0.1
|