-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathVagrantfile
51 lines (44 loc) · 1.32 KB
/
Vagrantfile
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
44
45
46
47
48
49
50
51
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
add-apt-repository ppa:duggan/bats --yes
apt-get update; apt-get install -y apache2 bats shellcheck curl
rm /var/www/html/index.html
tee /etc/apache2/sites-enabled/000-default.conf >/dev/null <<EOF
<VirtualHost *:80>
ServerName example.org
ServerAdmin [email protected]
DocumentRoot /var/www/html/
ScriptAlias "/index.html" "/usr/lib/cgi-bin/index.cgi"
ScriptAlias "/index" "/usr/lib/cgi-bin/index.cgi"
RedirectMatch 404 index.htsh
<Directory /var/www/html/>
AllowOverride none
Options -Indexes
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
Include conf-available/serve-cgi-bin.conf
</VirtualHost>
EOF
sed -i 's/www-data/vagrant/g' /etc/apache2/envvars
a2enmod cgid
service apache2 restart
cd /var/www/html && bats ./testing.bats
echo
echo "Got to http://localhost:8090"
SCRIPT
Vagrant.configure("2") do |config|
config.vm.define "bos" do |bos|
bos.vm.hostname = "bos"
bos.vm.box = "ubuntu/bionic64"
bos.vm.provision "shell", inline: $script
bos.vm.network "forwarded_port", guest: 80, host: 8090
bos.vm.synced_folder ".", "/var/www/html"
end
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 2
end
end