-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0-setup_web_static.sh
More file actions
44 lines (29 loc) · 971 Bytes
/
0-setup_web_static.sh
File metadata and controls
44 lines (29 loc) · 971 Bytes
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
#!/usr/bin/env bash
# Fuck Fabric3==1.14.post1 installation guide,
# It took me almost 5 hours!
sudo apt -y update
sudo apt -y install nginx
sudo mkdir -p /data/web_static/releases/test/
sudo mkdir -p /data/web_static/shared/
cd /data/web_static/releases/test || exit
echo 'Yel3an abo el Fabric3==1.14.post1' > index.html
sudo ln -sf /data/web_static/releases/test/ /data/web_static/current
sudo chown -R ubuntu:ubuntu /data/
sudo tee /etc/nginx/sites-available/default > /dev/null << 'EOF'
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
error_page 404 /error_404.html;
add_header X-Served-By $hostname;
location /hbnb_static {
alias /data/web_static/current;
}
location / {
try_files $uri $uri/ =404;
}
}
EOF
sudo service nginx restart