Project

General

Profile

Maintaining static websites on staticweb » History » Version 7

Ahmed Bilal, 04/30/2020 08:13 AM

1 1 Ahmed Bilal
h1. Maintaining static websites on staticweb
2 2 Ahmed Bilal
3 1 Ahmed Bilal
h2. Work In Progress
4
5
1. Add DNS Entry under *dot-cdist/files/dns/zones/ungleich.ch*
6
<pre>
7
staticcms-staging           CNAME staticweb
8
</pre>
9
2. Run the following command on control server.
10
<pre><code class="shell">cd ~/.cdist; git pull; cdist config -bj7 -p9 -vv d{1..7}.ungleich.ch</code></pre>
11 5 Ahmed Bilal
3. Run the following commands on staticweb.ungleich.ch
12
<pre><code class="shell">
13
mkdir -p /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www/u/
14
chown -R ungleichstatic /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www/
15
</code></pre>
16 4 Ahmed Bilal
4. Create nginx config for the site under **/etc/nginx/sites-enabled/staticcms-staging.ungleich.ch**
17 6 Ahmed Bilal
<pre><code>
18 1 Ahmed Bilal
server {
19 6 Ahmed Bilal
    listen *:80;
20
    listen [::]:80;
21 3 Ahmed Bilal
22
    server_name staticcms-staging.ungleich.ch;
23 6 Ahmed Bilal
    root /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www;
24 3 Ahmed Bilal
25
26 6 Ahmed Bilal
    # we can use root ... outside of the location block to keep it generic
27
    # HOWEVER we don't want this, as http only serves the path that is necessary for letsencrypt, nothing more
28
    # Ask Nico, if you don't believe this -- 20190421
29
    location /.well-known/acme-challenge/ {
30
        root /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www;
31
    }
32
    # Everything else -> ssl
33
    location / {
34
        return 301 https://$host$request_uri;
35
    }
36 3 Ahmed Bilal
}
37
</code></pre>