mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2024-11-14 01:10:20 +01:00
This commit is contained in:
parent
35e662cd00
commit
8a4f5f3ff2
2 changed files with 16 additions and 5 deletions
14
README.md
14
README.md
|
@ -32,10 +32,22 @@ On Debian/Ubuntu, a default virtualhost is included in Apache's configuration. S
|
||||||
|
|
||||||
apache_vhosts:
|
apache_vhosts:
|
||||||
# Additional optional properties: 'serveradmin, serveralias, extra_parameters'.
|
# Additional optional properties: 'serveradmin, serveralias, extra_parameters'.
|
||||||
- {servername: "local.dev", documentroot: "/var/www/html"}
|
- servername: "local.dev"
|
||||||
|
documentroot: "/var/www/html"
|
||||||
|
|
||||||
Add a set of properties per virtualhost, including `servername` (required), `documentroot` (required), `serveradmin` (optional), `serveralias` (optional) and `extra_parameters` (optional: you can add whatever additional configuration lines you'd like in here).
|
Add a set of properties per virtualhost, including `servername` (required), `documentroot` (required), `serveradmin` (optional), `serveralias` (optional) and `extra_parameters` (optional: you can add whatever additional configuration lines you'd like in here).
|
||||||
|
|
||||||
|
Here's an example using `extra_parameters` to add a RewriteRule to redirect all requests to the `www.` site:
|
||||||
|
|
||||||
|
- servername: "www.local.dev"
|
||||||
|
serveralias: "local.dev"
|
||||||
|
documentroot: "/var/www/html"
|
||||||
|
extra_parameters: |
|
||||||
|
RewriteCond %{HTTP_HOST} !^www\. [NC]
|
||||||
|
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
||||||
|
|
||||||
|
The `|` denotes a multiline scalar block in YAML, so newlines are preserved in the resulting configuration file output.
|
||||||
|
|
||||||
apache_vhosts_ssl: []
|
apache_vhosts_ssl: []
|
||||||
|
|
||||||
No SSL vhosts are configured by default, but you can add them using the same pattern as `apache_vhosts`, with a few additional directives, like the following example:
|
No SSL vhosts are configured by default, but you can add them using the same pattern as `apache_vhosts`, with a few additional directives, like the following example:
|
||||||
|
|
|
@ -13,18 +13,17 @@ apache_remove_default_vhost: false
|
||||||
|
|
||||||
apache_vhosts:
|
apache_vhosts:
|
||||||
# Additional properties: 'serveradmin, serveralias, extra_parameters'.
|
# Additional properties: 'serveradmin, serveralias, extra_parameters'.
|
||||||
- {servername: "local.dev", documentroot: "/var/www/html"}
|
- servername: "local.dev"
|
||||||
|
documentroot: "/var/www/html"
|
||||||
|
|
||||||
apache_vhosts_ssl: []
|
apache_vhosts_ssl: []
|
||||||
# Additional properties: 'serveradmin, extra_parameters'.
|
# Additional properties: 'serveradmin, extra_parameters'.
|
||||||
# - {
|
# - servername: "local.dev",
|
||||||
# servername: "local.dev",
|
|
||||||
# documentroot: "/var/www/html",
|
# documentroot: "/var/www/html",
|
||||||
# certificate_file: "/path/to/certificate.crt",
|
# certificate_file: "/path/to/certificate.crt",
|
||||||
# certificate_key_file: "/path/to/certificate.key",
|
# certificate_key_file: "/path/to/certificate.key",
|
||||||
# # Optional.
|
# # Optional.
|
||||||
# certificate_chain_file: "/path/to/certificate_chain.crt"
|
# certificate_chain_file: "/path/to/certificate_chain.crt"
|
||||||
# }
|
|
||||||
|
|
||||||
apache_ssl_protocol: "All -SSLv2 -SSLv3"
|
apache_ssl_protocol: "All -SSLv2 -SSLv3"
|
||||||
apache_ssl_cipher_suite: "AES256+EECDH:AES256+EDH"
|
apache_ssl_cipher_suite: "AES256+EECDH:AES256+EDH"
|
||||||
|
|
Loading…
Reference in a new issue