tech:notes_cockpit
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:notes_cockpit [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:notes_cockpit [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Cockpit | ||
| + | |||
| + | Mots clefs : Administration Webmin Supervision Docker | ||
| + | |||
| + | |||
| + | ~~~bash | ||
| + | apt-get install cockpit-system cockpit cockpit-docker cockpit-tests | ||
| + | |||
| + | # Fix bug Storage | ||
| + | mkdir -p / | ||
| + | |||
| + | mkdir / | ||
| + | |||
| + | # Bind seulement sur localhost | ||
| + | cat <<EOF > / | ||
| + | [Socket] | ||
| + | ListenStream= | ||
| + | ListenStream=127.0.0.1: | ||
| + | EOF | ||
| + | |||
| + | systemctl daemon-reload | ||
| + | systemctl restart cockpit.socket | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | [WebService] | ||
| + | Origins = https:// | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | `/ | ||
| + | ~~~nginx | ||
| + | server { | ||
| + | listen | ||
| + | listen [::]:443 ssl; | ||
| + | server_name | ||
| + | | ||
| + | location / { | ||
| + | # Required to proxy the connection to Cockpit | ||
| + | proxy_pass http:// | ||
| + | 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 " | ||
| + | |||
| + | # Pass ETag header from Cockpit to clients. | ||
| + | # See: https:// | ||
| + | gzip off; | ||
| + | } | ||
| + | |||
| + | ssl_certificate / | ||
| + | ssl_certificate_key / | ||
| + | } | ||
| + | server { | ||
| + | if ($host = cockpit.acme.fr) { | ||
| + | return 301 https:// | ||
| + | } # managed by Certbot | ||
| + | |||
| + | |||
| + | listen | ||
| + | server_name | ||
| + | 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 * * * / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | ## Gérer les VM Libvirt avec Cockpit | ||
| + | |||
| + | Voir [[notes_libvirt]] | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install cockpit cockpit-machines | ||
| + | ~~~ | ||
| + | |||
