Cockpit 在线终端 简单服务器监控

安装

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

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

凯尔kyle

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值