#!/bin/bash # # Provisioner for the hosting environment # # Parameters DIRNAME="`dirname $0`" # Basic dependencies DEPENDENCIES="apache2" # Check for sudo if [ "`whoami`" != "root" ]; then SUDO="sudo" fi # Ensure an up-to-date system $SUDO apt-get update && $SUDO apt-get dist-upgrade -y && $SUDO apt-get autoremove -y && $SUDO apt-get clean # Install dependencies $SUDO apt install -y $DEPENDENCIES # Configure virtual host for the local service cat <<-EOF | $SUDO tee /etc/apache2/sites-available/local.conf > /dev/null ServerName estudo.local DocumentRoot "/srv/shared/site" Options Indexes FollowSymLinks AllowOverride All Require all granted EOF # Enable virtual host $SUDO a2ensite local $SUDO systemctl reload apache2 # Configure PATH #mkdir -p ~/.custom #echo 'export PATH=$PATH:/srv/shared/scripts' > ~/.custom/profile