Project

General

Profile

Maintaining static websites on staticweb » History » Revision 7

Revision 6 (Ahmed Bilal, 04/30/2020 08:13 AM) → Revision 7/8 (Ahmed Bilal, 04/30/2020 08:13 AM)

h1. Maintaining static websites on staticweb 

 

 h2. Work In Progress 

 1. Add DNS Entry under *dot-cdist/files/dns/zones/ungleich.ch* 
 <pre> 
 staticcms-staging             CNAME staticweb 
 </pre> 
 2. Run the following command on control server. 
 <pre><code class="shell">cd ~/.cdist; git pull; cdist config -bj7 -p9 -vv d{1..7}.ungleich.ch</code></pre> 
 3. Run the following commands on staticweb.ungleich.ch 
 <pre><code class="shell"> 
 mkdir -p /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www/u/ 
 chown -R ungleichstatic /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www/ 
 </code></pre> 
 4. Create nginx config for the site under **/etc/nginx/sites-enabled/staticcms-staging.ungleich.ch** 
 <pre><code> 
 
 
 server { 
     listen *:80; 
     listen [::]:80; 

     server_name staticcms-staging.ungleich.ch; 
     root /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www; 


     # we can use root ... outside of the location block to keep it generic 
     # HOWEVER we don't want this, as http only serves the path that is necessary for letsencrypt, nothing more 
     # Ask Nico, if you don't believe this -- 20190421 
     location /.well-known/acme-challenge/ { 
         root /home/services/www/ungleichstatic/staticcms-staging.ungleich.ch/www; 
     } 
     

     # Everything else -> ssl 
     location / { 
         return 301 https://$host$request_uri; 
     } 
 } 
 </code></pre>