安装
https://cockpit-project.org/running.html#centos
yum install cockpit
==========================================================================================================================================================================================================
Package Arch Version Repository Size
==========================================================================================================================================================================================================
Installing:
cockpit x86_64 195.6-1.el7.centos base 48 k
Installing for dependencies:
cockpit-bridge x86_64 195.6-1.el7.centos base 553 k
cockpit-system noarch 195.6-1.el7.centos base 1.6 M
cockpit-ws x86_64 195.6-1.el7.centos base 806 k
glib-networking x86_64 2.56.1-1.el7 base 145 k
gsettings-desktop-schemas x86_64 3.28.0-3.el7 base 606 k
json-glib x86_64 1.4.2-2.el7 base 134 k
Transaction Summary
==========================================================================================================================================================================================================
sudo systemctl enable --now cockpit.socket
systemctl status cockpit.socket
systemctl restart cockpit.socket
打开WEB界面访问9090端口即可
https://localhost:9090
proxy 代理
[root@as4k conf.d]# cat cockpit-8002.conf
server {
listen 8002 ssl;
server_name as4k.top;
ssl_certificate /root/xsh/as4k-top-cert/4011057_as4k.top.pem;
ssl_certificate_key /root/xsh/as4k-top-cert/4011057_as4k.top.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
# Required to proxy the connection to Cockpit
proxy_pass https://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;
}
}
touch /etc/cockpit/cockpit.conf
[root@as4k conf.d]# cat /etc/cockpit/cockpit.conf
[WebService]
Origins = https://as4k.top:8002 wss://as4k.top:8002
ProtocolHeader = X-Forwarded-Proto
重启nginx 和 cockpit