<commit_before># setup apache to work well with vagrant
function setup_apache () {
    local mpm=${1:-worker}
    has apache2-mpm-$mpm || {
        echo "Setting up Apache HTTP server... "
        apt-install apache2-mpm-$mpm

        [ -f /etc/apache2/envvars.orig ] || {
            sed -i.orig "s/USER=www-data/USER=${user}/;s/GROUP=www-data/GROUP=${group}/" \
                /etc/apache2/envvars
            chown -R $user:$group /var/log/apache2 /var/lock/apache2
        }
        # suppress warnings
        [ -f /etc/apache2/conf.d/hostname ] || {
            echo "ServerName vagrant" > /etc/apache2/conf.d/hostname
        }

        rm -rf /var/www
        ln -sf /vagrant /var/www

        service apache2 restart >/dev/null
    }
}

[[ -z "${MPM}" ]] || setup_apache $MPM<commit_msg>Fixed apache module and added option to specify the document root.<commit_after>#!/usr/bin/env bash

provision apt

# setup apache to work well with vagrant
function setup-apache () {
    local mpm=${1:-worker}
    local docroot=${2:-/vagrant/public}

    has apache2-mpm-$mpm || {
        echo "Setting up Apache HTTP server... "
        apt-install apache2-mpm-$mpm

        [ -f /etc/apache2/envvars.orig ] || {
            sed -i.orig "s/USER=www-data/USER=${user}/;s/GROUP=www-data/GROUP=${group}/" \
                /etc/apache2/envvars
            chown -R $user:$group /var/log/apache2 /var/lock/apache2
        }
        # suppress warnings
        [ -f /etc/apache2/conf.d/hostname ] || {
            echo "ServerName vagrant" > /etc/apache2/conf.d/hostname
        }

        rm -rf /var/www
        [ -d $docroot ] && mkdir -p $docroot
        ln -sf $docroot /var/www

        service apache2 restart >/dev/null
    }
}

function setup_apache () {
    echo "setup_apache is deprecated, use setup-apache instead." >&2
    setup-apache $@
}

[[ -z "${MPM}" ]] || setup-apache $MPM
{'fraction_non_alphanumeric': 0.149364406779661, 'fraction_numerical': 0.011652542372881356, 'mean_word_length': 1.9469578783151327, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '5054871', 'n_tokens_mistral': 648, 'n_tokens_neox': 625, 'n_words': 142}