Project

General

Profile

Maintaining static websites on staticweb » History » Version 6

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
 
19 1 Ahmed Bilal
server {
20 6 Ahmed Bilal
    listen *:80;
21
    listen [::]:80;
22 3 Ahmed Bilal
23
    server_name staticcms-staging.ungleich.ch;
24 6 Ahmed Bilal
    root /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www;
25 3 Ahmed Bilal
26
27 6 Ahmed Bilal
    # we can use root ... outside of the location block to keep it generic
28
    # HOWEVER we don't want this, as http only serves the path that is necessary for letsencrypt, nothing more
29
    # Ask Nico, if you don't believe this -- 20190421
30
    location /.well-known/acme-challenge/ {
31
        root /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www;
32
    }
33
34
    # Everything else -> ssl
35
    location / {
36
        return 301 https://$host$request_uri;
37
    }
38 3 Ahmed Bilal
}
39
</code></pre>