mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2024-11-09 15:33:30 +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:
|
||||
# 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).
|
||||
|
||||
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: []
|
||||
|
||||
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:
|
||||
# Additional properties: 'serveradmin, serveralias, extra_parameters'.
|
||||
- {servername: "local.dev", documentroot: "/var/www/html"}
|
||||
- servername: "local.dev"
|
||||
documentroot: "/var/www/html"
|
||||
|
||||
apache_vhosts_ssl: []
|
||||
# Additional properties: 'serveradmin, extra_parameters'.
|
||||
# - {
|
||||
# servername: "local.dev",
|
||||
# - servername: "local.dev",
|
||||
# documentroot: "/var/www/html",
|
||||
# certificate_file: "/path/to/certificate.crt",
|
||||
# certificate_key_file: "/path/to/certificate.key",
|
||||
# # Optional.
|
||||
# certificate_chain_file: "/path/to/certificate_chain.crt"
|
||||
# }
|
||||
|
||||
apache_ssl_protocol: "All -SSLv2 -SSLv3"
|
||||
apache_ssl_cipher_suite: "AES256+EECDH:AES256+EDH"
|
||||
|
|
Loading…
Reference in a new issue