wmdeit-cf-wmdelib/templates/httpd-vhost.conf.mustache

58 lines
2.4 KiB
Plaintext
Raw Normal View History

2023-09-24 16:17:02 +00:00
#
# Managed by CFEengine
#
2023-10-07 22:36:00 +00:00
<Directory {{vars.apache_vhost.site.doc_root}}>
2023-09-24 16:17:02 +00:00
AllowOverride all
Options Indexes FollowSymLinks
Require all granted
<FilesMatch ".+(\.php)$">
SetHandler application/x-httpd-php
</FilesMatch>
DirectoryIndex index.php index.html
</Directory>
{{^vars.apache_vhost.site.ssl}}
<VirtualHost *:80>
ServerName {{vars.apache_vhost.site.domain}}
RewriteEngine On
Alias /.well-known/acme-challenge/ "{{vars.apache.default_html_dir}}/.well-known/acme-challenge/"
RewriteRule "^/.well-known/acme-challenge/" - [L]
2023-10-07 22:36:00 +00:00
DocumentRoot "{{vars.apache_vhost.site.doc_root}}"
2023-09-24 16:17:02 +00:00
ServerAlias {{#vars.apache_vhost.site.aliases}}{{.}} {{/vars.apache_vhost.site.aliases}}
ErrorLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-error.log"
CustomLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-access.log" combined
2023-09-27 20:07:20 +00:00
{{vars.apache_vhost.site.raw}}
2023-09-24 16:17:02 +00:00
</VirtualHost>
{{/vars.apache_vhost.site.ssl}}
{{#vars.apache_vhost.site.ssl}}
<VirtualHost *:80>
ServerName {{vars.apache_vhost.site.domain}}
ServerAlias {{#vars.apache_vhost.site.aliases}}{{.}} {{/vars.apache_vhost.site.aliases}}
RewriteEngine On
Alias /.well-known/acme-challenge/ "{{vars.apache.default_html_dir}}/.well-known/acme-challenge/"
RewriteRule "^/.well-known/acme-challenge/" - [L]
2023-10-07 22:36:00 +00:00
DocumentRoot "{{vars.apache_vhost.site.doc_root}}"
2023-09-24 16:17:02 +00:00
Redirect permanent / https://{{vars.apache_vhost.site.domain}}/
</VirtualHost>
<VirtualHost *:443>
ServerAdmin {{vars.apache_vhost.site.email}}
2023-10-07 22:36:00 +00:00
DocumentRoot "{{vars.apache_vhost.site.doc_root}}"
2023-09-24 16:17:02 +00:00
ServerName {{vars.apache_vhost.site.domain}}
ServerAlias {{#vars.apache_vhost.site.aliases}}{{.}} {{/vars.apache_vhost.site.aliases}}
ErrorLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-error.log"
CustomLog "{{vars.apache.log_dir}}/{{vars.apache_vhost.site.domain}}-access.log" combined
# SSL
SSLEngine on
2023-09-30 07:58:07 +00:00
# SSLCertificateFile {{vars.certbot.certbot_dir}}/live/{{vars.apache_vhost.site.domain}}/fullchain.pem
# SSLCertificateKeyFile {{vars.certbot.certbot_dir}}/live/{{vars.apache_vhost.site.domain}}/privkey.pem
SSLCertificateFile {{vars.apache_vhost.ssl_cert}}
SSLCertificateKeyFile {{vars.apache_vhost.ssl_key}}
2023-09-24 16:17:02 +00:00
RewriteEngine On
Alias /.well-known/acme-challenge/ "{{vars.apache.default_html_dir}}/.well-known/acme-challenge/"
RewriteRule "^/.well-known/acme-challenge/" - [L]
2023-09-30 07:58:07 +00:00
{{{vars.apache_vhost.site.raw}}}
2023-09-24 16:17:02 +00:00
</VirtualHost>
{{/vars.apache_vhost.site.ssl}}