Outils pour utilisateurs

Outils du site


tech:notes_cockpit

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
tech:notes_cockpit [2025/11/11 16:52] Jean-Baptistetech:notes_cockpit [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon Supervision Docker}}
 +
 +# Notes Cockpit
 +
 +Mots clefs : Administration Webmin Supervision Docker 
 +
 +
 +~~~bash
 +apt-get install cockpit-system cockpit cockpit-docker cockpit-tests
 +
 +# Fix bug Storage
 +mkdir -p /usr/lib/x86_64-linux-gnu/udisks2/modules
 +
 +mkdir /etc/systemd/system/cockpit.socket.d/
 +
 +# Bind seulement sur localhost
 +cat <<EOF > /etc/systemd/system/cockpit.socket.d/listen.conf 
 +[Socket]                                                                                                                                                                
 +ListenStream=                                                                                                                                                           
 +ListenStream=127.0.0.1:9090
 +EOF
 +
 +systemctl daemon-reload
 +systemctl restart cockpit.socket
 +~~~
 +
 +`/etc/cockpit/cockpit.conf`
 +~~~ini
 +[WebService]
 +Origins = https://cockpit.acme.fr
 +~~~
 +
 +
 +`/etc/nginx/sites-available/cockpit.acme.fr`
 +~~~nginx                                                                                             
 +server {                                                                                                                                                                
 +    listen         443 ssl;                                                                                                                                             
 +    listen [::]:443 ssl;                                                                                                                                                
 +    server_name    cockpit.acme.fr;                                                                                                                                
 +                                                                                                                                                                        
 +    location / {                                                                                                                                                        
 +        # Required to proxy the connection to Cockpit                                                                                                                   
 +        proxy_pass http://127.0.0.1:9090;                                                                                                                              
 +        proxy_set_header Host $host;                                                                                                                                    
 +        proxy_set_header X-Forwarded-Proto $scheme;                                                                                                                     
 +                                                                                                                                                                        
 +        # Required for web sockets to function                                                                                                                          
 +        proxy_http_version 1.1;                                                                                                                                         
 +        proxy_buffering off;                                                                                                                                            
 +        proxy_set_header Upgrade $http_upgrade;                                                                                                                         
 +        proxy_set_header Connection "upgrade";
 +
 +        # Pass ETag header from Cockpit to clients.
 +        # See: https://github.com/cockpit-project/cockpit/issues/5239
 +        gzip off;
 +    }
 +
 +    ssl_certificate /etc/letsencrypt/live/cockpit.acme.fr/fullchain.pem; # managed by Certbot
 +    ssl_certificate_key /etc/letsencrypt/live/cockpit.acme.fr/privkey.pem; # managed by Certbot
 +}
 +server {
 +    if ($host = cockpit.acme.fr) {
 +        return 301 https://$host$request_uri;
 +    } # managed by Certbot
 +
 +
 +    listen         80;
 +    server_name    cockpit.acme.fr;
 +    return 404; # managed by Certbot
 +
 +
 +}
 +~~~
 +
 +~~~bash
 +sudo certbot --nginx -d cockpit.acme.fr -d www.cockpit.acme.fr
 +~~~
 +
 +~~~bash
 +sudo env EDITOR=vim crontab -e
 +~~~
 +
 +Ajouter :
 +~~~
 +0 12 * * * /usr/bin/certbot renew --quiet
 +~~~
 +
 +
 +
 +## Gérer les VM Libvirt avec Cockpit
 +
 +Voir [[notes_libvirt]]
 +
 +~~~bash
 +apt-get install cockpit cockpit-machines
 +~~~
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki