-
Notifications
You must be signed in to change notification settings - Fork 34
/
vagrant.sh
43 lines (34 loc) · 896 Bytes
/
vagrant.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# This script provisions a VM for use with the FOIA proxy. It is run
# automatically by vagrant. Generally, the vagrant VM is not needed for
# development, only testing the foia-proxy.php and htaccess configuration.
set -o errexit
set -o pipefail
set -o nounset
# Update the OS
apt-get update
apt-get dist-upgrade -y
# Install the dependencies
apt-get install -y \
apache2 \
libapache2-mod-php \
php-curl
# Enable apache modules
a2enmod php7.0 \
rewrite \
headers
# Symlink document root to build dir
ln -sf /vagrant/_site /var/www/vagrant
# Site configuration for apache
cat <<EOF > /etc/apache2/sites-available/vagrant.conf
<VirtualHost *:80>
DocumentRoot /var/www/vagrant
<Directory /var/www/vagrant>
AllowOverride All
</Directory>
</VirtualHost>
EOF
# Enable our site, disable the rest
a2ensite vagrant
a2dissite 000-default
systemctl restart apache2