From: Christian Heller <c.heller@plomlompom.de>
Date: Mon, 3 Dec 2018 23:14:57 +0000 (+0100)
Subject: Improve web server setup.
X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/%7B%7Bdb.prefix%7D%7D/processes?a=commitdiff_plain;h=343ba52a819d96a5c4b194f6ae8d056bd10252d9;p=config

Improve web server setup.
---

diff --git a/all_new_2018/linkable_etc_files/web/etc/nginx/nginx.conf b/all_new_2018/linkable_etc_files/web/etc/nginx/nginx.conf
index 1072651..c5cbe48 100644
--- a/all_new_2018/linkable_etc_files/web/etc/nginx/nginx.conf
+++ b/all_new_2018/linkable_etc_files/web/etc/nginx/nginx.conf
@@ -26,7 +26,7 @@ http {
 	#access_log /var/log/nginx/access.log;
 	#error_log /var/log/nginx/error.log;
 
-        # HTTP server: only enforce HTTPS 
+        # HTTP server: only enforce HTTPS
         server {
                 listen 80;
                 return 301 https://$host$request_uri;
@@ -35,9 +35,9 @@ http {
 	# HTTPS server
         server {
                 listen 443 ssl;
-                server_name web20181130.plomlompom.com;
-                ssl_certificate /etc/letsencrypt/live/web20181130.plomlompom.com/fullchain.pem;
-                ssl_certificate_key /etc/letsencrypt/live/web20181130.plomlompom.com/privkey.pem;
+                server_name REPLACE_fqdn_ECALPER;
+                ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
+                ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
                 root /var/www/html/;
 		index index.html index.htm index.nginx-debian.html;
         }
diff --git a/all_new_2018/setup_web.sh b/all_new_2018/setup_web.sh
new file mode 100644
index 0000000..8aac7ef
--- /dev/null
+++ b/all_new_2018/setup_web.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+
+./hardlink_etc.sh web
+sed -i "s/REPLACE_fqdn_ECALPER/$(hostname -f)/g" /etc/nginx/nginx.conf
+apt -y -o Dpkg::Options::=--force-confold install nginx
+iptables-restore /etc/iptables/rules.v4