prak2-scripts/BayamWebServer/09.sh
2024-10-03 14:05:20 +07:00

35 lines
718 B
Bash

#!/bin/bash
curl -o web.zip https://fs.taufan.dev/public/jarkom/sayur_webserver_nginx.zip
unzip web.zip
mv sayur_webserver_nginx /var/www/sayur
service nginx start
service php7.2-fpm start
cat > /etc/nginx/conf.d/sayur.conf <<EOL
server {
listen 80;
listen [::]:80;
root /var/www/sayur;
index index.php;
server_name brokoli.f01.com www.brokoli.f01.com buncis.f01.com www.buncis.f01.com bayam.f01.com www.bayam.f01.com;
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.2-fpm.sock;
}
}
EOL
nginx -s reload