#!/bin/bash

set -x

# To meet uploading requirements.
apt install rsync

d=test
mkdir -p /srv/www/$d
chown user:user /srv/www/$d

cat <<EOF >/etc/apache2/sites-available/$d.conf
<VirtualHost $d.defun.work:*>
	DocumentRoot /srv/www/$d

    <Directory "/srv/www/$d/">
        Require all granted
    </Directory>
</VirtualHost>
EOF

a2ensite $d
service apache2 restart
