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
|
2023-10-27 23:11:46 +00:00
|
|
|
Options {{ vars.apache_vhost.site.doc_root_options }}
|
2023-09-24 16:17:02 +00:00
|
|
|
Require all granted
|
2023-10-27 23:11:46 +00:00
|
|
|
{{#vars.apache_vhost.site.php}}
|
2023-09-24 16:17:02 +00:00
|
|
|
<FilesMatch ".+(\.php)$">
|
2023-10-27 23:11:46 +00:00
|
|
|
SetHandler {{vars.apache_vhost.site.php_handler}}
|
2023-09-24 16:17:02 +00:00
|
|
|
</FilesMatch>
|
2023-10-27 23:11:46 +00:00
|
|
|
{{/vars.apache_vhost.site.php}}
|
|
|
|
|
2023-09-24 16:17:02 +00:00
|
|
|
DirectoryIndex index.php index.html
|
2023-10-27 23:11:46 +00:00
|
|
|
{{{vars.apache_vhost.site.dir_raw}}}
|
2023-09-24 16:17:02 +00:00
|
|
|
</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}}
|
2023-12-07 12:05:56 +00:00
|
|
|
{{#vars.apache_vhost.site.logging80}}
|
2023-09-24 16:17:02 +00:00
|
|
|
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-12-07 12:05:56 +00:00
|
|
|
{{/vars.apache_vhost.site.logging80}}
|
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}}"
|
2024-07-20 21:22:24 +00:00
|
|
|
# Redirect permanent / https://{{vars.apache_vhost.site.domain}}/
|
|
|
|
RewriteRule ^(.*)$ https://{{vars.apache_vhost.site.domain}}$1 [R=301,L]
|
2023-09-24 16:17:02 +00:00
|
|
|
</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}}
|
2023-12-07 12:05:56 +00:00
|
|
|
|
|
|
|
{{#vars.apache_vhost.site.logging443}}
|
2023-09-24 16:17:02 +00:00
|
|
|
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-12-07 12:05:56 +00:00
|
|
|
{{/vars.apache_vhost.site.logging443}}
|
2023-09-24 16:17:02 +00:00
|
|
|
# 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]
|
2024-07-20 21:22:24 +00:00
|
|
|
<Location /.well-known/acme-challenge/ >
|
|
|
|
</Location>
|
|
|
|
|
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}}
|
|
|
|
|