Linux-dash是一款为Linux设计的基于Web的轻量级监控面板。这个程序会实时显示各种不同的系统属性,比如CPU负载、RAM使用率、磁盘使用率、网速、网络连接、RX/TX带宽、登录用户、运行的进程等等。它不会存储长期的统计。因为它没有后端数据库。

本篇文章将会向你展示如何安装和设置Linux dash,这里所使用的Web服务器是Nginx.

1.安装

首先我们要启用EPEL 仓库

接下来,我们需要用下面的命令安装nginx。

sudo yum install nginx

安装 php-fpm 组件(如何确定哪个软件是否安装请参考:[转]在linux下如何判断是否已经安装某个软件?软件安装在哪个目录

sudo yum install git php-common php-fpm

现在我们要在nginx中配置Linux-dash。我们如下创建 /etc/nginx/conf.d/linuxdash.conf。

注:我的系统是CentOS6.5 已经安装了apach 和 php 。后来发现linux-dash配置起作用的不是linuxdash.conf 而是人家默认的 default.conf (无语)具体那个起作用请参考自己的系统。

sudo vim /etc/nginx/conf.d/linuxdash.conf
  1 server {
2 server_name localhost;
3 listen 8080;
4 root /var/www;
5 index index.html index.php;
6 access_log /var/log/nginx/access.log;
7 error_log /var/log/nginx/error.log;
8
9 location ~* \.(?:xml|ogg|mp3|mp4|ogv|svg|svgz|eot|otf|woff|ttf|css|js|jpg|jpeg|gif|png|ico)$ {
10 try_files $uri =404;
11 expires max;
12 access_log off;
13 add_header Pragma public;
14 add_header Cache-Control "public, must-revalidate, proxy-revalidate";
15 }
16
17 location /linux-dash {
18 index index.html index.php;
19 }
20
21 # PHP-FPM via sockets
22 location ~ \.php(/|$){
23 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
24 fastcgi_split_path_info ^(.+?\.php)(/.*)$;
25 fastcgi_pass unix:/var/run/php-fpm.sock;
26 if (!-f $document_root$fastcgi_script_name){
27 return 404;
28 }
29 try_files $uri $uri//index.php?$args;
30 include fastcgi_params;
31 }
32 }

有的资料说  第一行是 :server_name $domain_name; 我配置后这启动服务是报错(但是服务能启动):

[root@bogon var]# service nginx restart
nginx: [warn] conflicting server name "$domain_name" on 0.0.0.0:8080, ignored
Stopping nginx:                                            [  OK  ]
Starting nginx: nginx: [warn] conflicting server name "$domain_name" on 0.0.0.0:8080, ignored
                                                           [  OK  ]

注意:26行 if 和 ( 之间是有空格的!空格的!空格的!

我这nginx使用端口为8080,如果使用80端口会和 httpd 冲突,网上说的kill 80端口其他服务,我只想想说,把httpd关了  我的网站怎么办。nginx就是个附带玩意,有意么?

2.下一步是配置php-fpm。用编辑器打开/etc/php-fpm.d/www.conf。

sudo vim /etc/php-fpm.d/www.conf

确保设置了如下的“listen”,“user”和“group”字段。你可以保留其它的配置不变。

. . .
listen = /var/run/php-fpm.sock
user = nginx
group = nginx
. . .

现在,我们要在/var/www中下载并安装linux-dash。

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

接下来,重启 Nginx和php-fpm并设置开机启动。

sudo service nginx restart
sudo service php-fpm restart sudo chkconfig nginx on
sudo chkconfig php-fpm on

我们使用TCP端口8080配置linux-dash。因此需确保防火墙没有开放8080 TCP端口。

3.用linux-dash监控Linux服务器

你现在可以在浏览器中输入http://<IP地址>:8080/linux-dash/来访问Linux-dash。

web面板包含了不同的组件,每个都显示独特的系统属性。你可以自定义web面板的外观也可以关闭一些组件。(我的是虚拟机上安装CentOS6.5在虚拟机浏览器上能看,但是到本地电脑上就不行了,555,为毛?还用人家的截图吧,我的有隐私-_-! )

嘎嘎!总算能用了,噢耶,来碗扁粉菜!

【转】如何在CentOS/RHEL中安装基于Web的监控系统 linux-das的更多相关文章

  1. 如何在 CentOS 8 中安装 Cockpit Web 控制台

    如何在 CentOS 8 中安装 Cockpit Web 控制台 [日期:2019-10-31] 来源:Linux公社  作者:醉落红尘 [字体:大 中 小]   在本文中,我们将帮助您在CentOS ...

  2. 如何在 CentOS 7 中安装、配置和安全加固 FTP 服务

    步骤 1:安装 FTP 服务器 1. 安装 vsftpd 服务器很直接,只要在终端运行下面的命令. # yum install vsftpd 2. 安装完成后,服务先是被禁用的,因此我们需要手动启动, ...

  3. 如何在CentOS 7中安装最新Git(源码安装)

    如何在CentOS 7中安装最新Git 2017年05月20日 11:49:53 阅读数:1624 Git是在今天的软件开发行业一个非常有用的版本控制工具.我一直使用Git.于是为Linux公社的读者 ...

  4. 如何在 CentOS 7 中安装或升级最新的内核

    虽然有些人使用 Linux 来表示整个操作系统,但要注意的是,严格地来说,Linux 只是个内核.另一方面,发行版是一个完整功能的系统,它建立在内核之上,具有各种各样的应用程序工具和库. 在正常操作期 ...

  5. 基于Web的监控系统的开发进行分布式和现代生产(外文翻译)

    摘要 近年来,Web技术发展迅速.尤其是网络浏览器增强了其功能因为JavaScript,CSS3和HTML5的改进.因此,功能越来越丰富的基于Web的软件解决方案功能范围可用.通过使用响应式网页设计( ...

  6. 在CentOS 7中安装nginx服务器

    简要地介绍一下,如何在CentOS 7中安装nginx服务器  下载对应当前系统版本的nginx包(package) # wget  http://nginx.org/packages/centos/ ...

  7. 在CentOS 7中安装Jetty服务器

    Jetty 是一款纯Java的HTTP (Web) 服务器和Java Servlet容器. 通常在更大的网络框架中,Jetty经常用于设备间的通信,而其他Web服务器通常给"人类" ...

  8. CentOS 7中安装和配置Promethues

    Prometheus 是什么? Prometheus是一套开源的监控&报警&时间序列数据库的组合,起始是由SoundCloud公司开发的.随着发展,越来越多公司和组织接受采用Prome ...

  9. 如何在 CentOS 7 上安装 Python 3

    当前最新的 CentOS 7.5 默认安装的是 Python 2.7.5,并且默认的官方 yum 源中不提供 Python 3 的安装包.这里主要介绍两种在 CentOS 7 中安装 Python 3 ...

随机推荐

  1. mac下配置cocos2d-x3.0

    今天看到3.0的正式版公布了,就马上荡下来试试3.0,以下记录下环境变量配置过程 打开用户文件夹下.bash_profile文件,配置环境 1.首先配置下android sdk,我的是在opt文件夹下 ...

  2. Android中使用NDK

    首先用Android Studio下载NDK 这个比较简单,就不多说了 1.写调用jni的Java代码 新建一个JniUtils类 public class JniUtils { static { S ...

  3. 五毛的cocos2d-x学习笔记05-场景与场景动画,动作

    场景切换函数: Director->getInstance()->replaceScene(Scene*); Director->getInstance()->runWithS ...

  4. C#常用控件缩写

  5. debian6 更新python版本到python3.3

    1.下载python3.3安装包 #wget wget --no-cookie --no-check-certificate --header "Cookie:gpw_e24=http%3A ...

  6. 搭建zend framework1开发环境

    1.和常规开发大致相同,首先下载zend framework1,下载地址如下 http://www.zendframework.com/downloads/latest 挑选其中一个下载,我下载的是f ...

  7. LNMP安装包sh脚本

    Xshell 5 (Build 0719) Copyright (c) 2002-2015 NetSarang Computer, Inc. All rights reserved. Type `he ...

  8. 进度记录 和 安装imagick时Cannot locate header file MagickWand.h错误的解决

    修改php.ini文件,已使php支持扩展的功能 [root@localhost imagick-2.2.2]# ./configure --with-php-config=/usr/local/ph ...

  9. python成长之路13

    一:SqlAlchemy ORM ORM:Object Relational Mapping 对象关系映射是一种程序技术,用于实现面向对象编程语言里不同类型系统的数据之间的转换 SQLAlchemy是 ...

  10. 解决gerber-Failed to Match All Shapes for PCB问题

    有效解决在Protel 99se导gerber时提示gerber-Failed to Match All Shapes for PCB出错问题如图 这种问题很好解决,打开这个窗口 操作方法如下图Emb ...