Linux系统轻量级监控工具linux-dash的安装方法

Linux系统监控工具linux-dash的安装方法

  • 一、linux-dash介绍
  • 二、初始环境安装
    • 1.系统版本
    • 2.安装apche
    • 3.安装python
    • 4.防火墙与selinux配置
      • ①selinux关闭
      • ②防火墙配置
  • 三、安装linux-dash工具
    • 1.下载软件包
    • 2. 查看linux-dash的源码
    • 3.重启httpd
    • 4. 访问linux-dash监控页面
  • 四、使用python方法启动程序(可选)
    • 1.进入index.py所在目录
    • 2.后台启动程序
    • 3.查看后台任务
    • 4. 访问linux-dash
  • 六、访问安全配置
    • 1.修改httpd配置文件
    • 2.新建.htaccess文件
    • 3.设置用户密码
    • 4.重启服务
  • 七、访问linux-dash监控页面

一、linux-dash介绍

  • linux-dash简介

Linux-dash是一个低开销的、基于Web的Linux服务器监控系统。

二、初始环境安装

1.系统版本

[root@jeven ~]# cat /etc/os-release 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

2.安装apche

yum -y install httpd  安装apache
systemctl enable --now httpd 开启服务

3.安装python

yum -y install python php php-fpm 

4.防火墙与selinux配置

①selinux关闭

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0

②防火墙配置

systemctl stop firewalld.service

centos6老版本关闭

# service iptables stop
# chkconfig iptables off

三、安装linux-dash工具

1.下载软件包

在/var/www/html目录下,下载linux dash的源码包。

cd /var/www/html
git clone https://github.com/afaqurk/linux-dash.git

2. 查看linux-dash的源码

查看linux-dash的源码目录。

[root@jeven linux-dash]# tree -L 2 ./
./
├── app
│   ├── index.html
│   ├── linuxDash.min.css
│   ├── linuxDash.min.js
│   ├── nohup.out
│   └── server
├── bin
│   └── linux-dash
├── demo.js
├── ecosystem.config.js
├── gulpfile.js
├── index.html
├── LICENSE.md
├── package.json
├── README.md
└── src
    ├── css
    └── js

6 directories, 12 files

3.重启httpd

systemctl restart httpd

4. 访问linux-dash监控页面

访问地址:http://192.168.3.166/linux-dash/app

Linux系统轻量级监控工具linux-dash的安装方法_第1张图片

四、使用python方法启动程序(可选)

1.进入index.py所在目录

进入index.py所在目录

cd  /var/www/html/linux-dash/app/server

2.后台启动程序

停止httpd服务,否则启动时会与httpd默认监听的80端口冲突,造成启动失败。

systemctl stop httpd

启动Linux dash的web服务

nohup python index.py &

3.查看后台任务

[root@jeven server]# jobs
[1]+  Running                 nohup python index.py &
[root@192 server]# 

4. 访问linux-dash

直接访问:http://192.168.3.166即可访问Linux-dash的监控页面。

Linux系统轻量级监控工具linux-dash的安装方法_第2张图片

六、访问安全配置

1.修改httpd配置文件

配置密码登录保护,我们使用httpd启动方式。

[root@jeven html]# cat /etc/httpd/conf.d/dash.conf
<Directory /var/www/html/linux-dash/app>

Options FollowSymLinks

AllowOverride All

Order allow,deny

allow from all

</Directory>


2.新建.htaccess文件

创建.htaccess文件。

vim /var/www/html/linux-dash/app/.htaccess
AuthType Basic

AuthName "Restricted Files"

AuthUserFile /var/www/html/linux-dash/app/.htpasswd

Require valid-user

3.设置用户密码

设置访问linux-dash页面的登录账号和密码。

[root@jeven html]# htpasswd -c /var/www/html/linux-dash/app/.htpasswd admin
New password: 
Re-type new password: 
Adding password for user admin


4.重启服务

systemctl restart httpd

七、访问linux-dash监控页面

访问地址:http://192.168.3.166/linux-dash/app/#/system-status,
此时需要输入刚设置的账号和密码:admin/admin,就能访问Linux-dash监控页面。

Linux系统轻量级监控工具linux-dash的安装方法_第3张图片

Linux系统轻量级监控工具linux-dash的安装方法_第4张图片

你可能感兴趣的:(Linux,linux,centos,apache,linux-dash,Linux监控)