如何在 CentOS 6 上安装 Linux Dash

在本教程中,我们将向您展示如何在 CentOS 6 上安装 Linux Dash。对于那些不知道的人, Linux破折号 是一个基于 Web 的轻量级 Linux 机器监控仪表板,它可以实时显示各种系统属性,例如 CPU 负载、RAM 使用情况、磁盘使用情况、互联网速度、网络连接、已安装的软件、正在运行的进程等等. Web 统计页面允许您拖放各种小部件并根据需要重新排列显示。

本文假设您至少具备 Linux 的基本知识,知道如何使用 shell,最重要的是,您将网站托管在自己的 VPS 上。 安装非常简单。 我将向您展示如何在 CentOS 6 上逐步安装 Linux-dash。

在 CentOS 6 上安装 Linux Dash

步骤 1. 安装 Nginx、PHP 和 PHP 模块。

要安装,首先必须将你的CentOS版本对应的Webtatic yum仓库信息添加到yum:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

安装 Nginx 网络服务器:

yum update yum install nginx16

安装 php-fpm 组件:

yum install php56w php56w-opcache --enablerepo=webtatic-testing yum install php56w-fpm --enablerepo=webtatic-testing yum install git

步骤 2. 配置 Nginx 网络服务器。

为 linux-dash 创建一个 Nginx Vhost。

##nano /etc/nginx/conf.d/your-domain.com
server {    listen  80;    server_name  your-domain.com www.your-domain.com;      access_log  /var/www/your-domain.com/logs/access.log ;    error_log    /var/www/your-domain.com/logs/error.log ;      location / {        root   /var/www/your-domain.com/public_html;        index  index.php index.html index.htm;      }      error_page   500 502 503 504  /50x.html;    location = /50x.html {        root   /var/www/your-domain.com/public_html;    }     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000   location ~ .php$ {   fastcgi_pass   127.0.0.1:9000;   fastcgi_index  index.php;   root    /var/www/your-domain.com/public_html;   fastcgi_param  SCRIPT_FILENAME  /var/www/your-domain/public_html$fastcgi_script_name;   include fastcgi_params;   }      location ~ /.ht {        deny  all;    } }

在 Nginx.conf 中添加主机:

# nano /etc/nginx/nginx.conf ### add line like this on http section: include /etc/nginx/conf.d/*.conf;

步骤 3. 配置 php-fpm。

确保编辑“user”、“group”和“listen”指令,如下所示。 您可以保持其余配置不变:

#nano /etc/php-fpm.d/www.conf  . . . listen = 127.0.0.1:9000 user = nginx group = nginx . . .

步骤 4. 下载并安装 Linux-dash。

git clone https://github.com/afaqurk/linux-dash.git cp -r linux-dash/ /var/www/your-domain.com/public_html chown -R nginx:nginx /var/www/your-domain.com/public_html

步骤 5. 重启 Nginx Web 服务器以及 php-fpm。

service nginx restart service php-fpm restart

将 nginx 和 PHP-fpm 设置为在启动时自动启动:

chkconfig nginx on chkconfig php-fpm on

步骤 6. 访问 Linux Dash。

默认情况下,Linux-dash 基于 Web 的监控将在 HTTP 端口 80 上可用。 打开您喜欢的浏览器并导航到 https://yourdomain.com 或 https://server-ip。 如果您使用防火墙,请打开端口 80 以启用对控制面板的访问。

恭喜! 您已成功安装 Linux Dash。 感谢您使用本教程在 CentOS 6 系统上安装基于 Web 的 Linux-dash 监控。