-
Notifications
You must be signed in to change notification settings - Fork 82
/
payload-rdr.tf
33 lines (32 loc) · 894 Bytes
/
payload-rdr.tf
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
# create payload redirector droplet
resource "digitalocean_droplet" "payload-rdr" {
image = "ubuntu-18-04-x64"
name = "payload-rdr"
region = "nyc3"
size = "s-1vcpu-1gb"
ssh_keys = ["${digitalocean_ssh_key.dossh.id}"]
provisioner "remote-exec" {
inline = [
"export DEBIAN_FRONTEND=noninteractive; apt update && apt-get -y -qq install apache2",
"a2enmod rewrite proxy proxy_http && service apache2 restart"
]
}
provisioner "file" {
source = "./configs/.htaccess"
destination = "/var/www/html/.htaccess"
}
provisioner "file" {
source = "./configs/apache2.conf"
destination = "/etc/apache2/apache2.conf"
}
provisioner "remote-exec" {
inline = [
"chmod 644 /var/www/html/.htaccess"
]
}
provisioner "remote-exec" {
inline = [
"a2enmod rewrite proxy proxy_http && service apache2 restart"
]
}
}