prak3-scripts/RonWeasley/06.sh

35 lines
623 B
Bash

#!/bin/bash
curl -o web.zip https://fs.taufan.dev/public/jarkom/web-modul-3.zip
unzip -d worker web.zip
mv worker /var/www
service nginx start
service php7.4-fpm start
cat > /etc/nginx/sites-enabled/default <<EOL
server {
listen 80;
listen [::]:80;
root /var/www/worker;
index index.php index.html index.htm;
server_name _;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
location / {
try_files \$uri \$uri/ /index.php?\$query_string =404;
}
location ~ \.php\$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
}
}
EOL
nginx -s reload