<commit_before>{% import _self as self %}
<VirtualHost *:{{ host.port }}>
{% if host.sslForce %}
    ServerName "{{ host.serverName }}"
    DocumentRoot "{{ host.documentRoot }}"
    Redirect permanent / https://{{ host.serverName }}/
{% else %}
{{ self.render_host(host) }}
{% endif %}
</VirtualHost>
{% if host.sslCertificate and host.sslCertificateKey %}

<VirtualHost *:{{ host.sslPort }}>
{{ self.render_host(host) }}

    SSLEngine on
    SSLCertificateFile "{{ host.sslCertificate }}"
    SSLCertificateKeyFile "{{ host.sslCertificateKey }}"
</VirtualHost>
{% endif %}
{% macro render_host(host) %}
    ServerName "{{ host.serverName }}"
    DocumentRoot "{{ host.documentRoot }}"

    <Directory "{{ host.documentRoot }}">
{% if host.handler == 'static' %}
        Options FollowSymLinks
        AllowOverride None
        Require all granted
        SetHandler default-handler
        {% if host.index %}DirectoryIndex {{ host.index }}{% endif %}

{% elseif host.handler == 'fusio' %}
        Options FollowSymLinks
        AllowOverride None
        Require all granted
        SetHandler application/x-httpd-php
        DirectoryIndex index.php

        RewriteEngine On
        RewriteBase /

        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule (.*) /index.php/$1 [L]

        RewriteCond %{HTTP:Authorization} ^(.*)
        RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
{% endif %}
    </Directory>
<commit_msg>improve apache config<commit_after>{% import _self as self %}
<VirtualHost *:{{ host.port }}>
{% if host.sslForce %}
    ServerName "{{ host.serverName }}"
    DocumentRoot "{{ host.documentRoot }}"
    Redirect permanent / https://{{ host.serverName }}/
{% else %}
{{ self.render_host(host) }}
{% endif %}
</VirtualHost>
{% if host.sslCertificate and host.sslCertificateKey %}

<VirtualHost *:{{ host.sslPort }}>
{{ self.render_host(host) }}

    SSLEngine on
    SSLCertificateFile "{{ host.sslCertificate }}"
    SSLCertificateKeyFile "{{ host.sslCertificateKey }}"
</VirtualHost>
{% endif %}
{% macro render_host(host) %}
    ServerName "{{ host.serverName }}"
    DocumentRoot "{{ host.documentRoot }}"

    <Directory "{{ host.documentRoot }}">
        Options FollowSymLinks
        AllowOverride None
        Require all granted
{% if host.index %}
        DirectoryIndex "/{{ host.index }}"
        FallbackResource "/{{ host.index }}"
{% endif %}
{% if host.handler == 'fusio' %}
        RewriteEngine On
        RewriteCond %{HTTP:Authorization} ^(.*)
        RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
{% endif %}
    </Directory>

{'fraction_non_alphanumeric': 0.15648854961832062, 'fraction_numerical': 0.0011450381679389313, 'mean_word_length': 3.134069400630915, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1218444', 'n_tokens_mistral': 855, 'n_tokens_neox': 768, 'n_words': 164}