(Linux系统监控工具Linux dash的安装方法)
一、Linux dash介绍
Linux-dash是一个低开销的、基于Web的Linux服务器监控系统
二、初始环境安装
1.系统版本
[root@server-01 ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="8 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="8"
2.安装apche
yum -y install httpd 安装apache
systemctl enable --now httpd 开启服务
3.安装php
yum -y python
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.下载软件包
cd /var/www/html
git clone https://github.com/afaqurk/linux-dash.git
2.重启httpd
systemctl restart httpd
四、使用python方法启动程序
1.进入index.py所在目录
cd /var/www/html/linux-dash/app/server
2.后台启动程序
nohup python index.py &
3.查看后台任务
[root@192 server]# jobs
[1]+ Running nohup python index.py &
[root@192 server]#
五、web界面访问
六、配置账户
1.httpd配置文件新增配置
[root@192 server]# vi /etc/httpd/conf.d/dash.conf
[root@192 server]# cat /etc/httpd/conf.d/dash.conf
<Directory /var/www/html/linux-dash>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
</Directory>
2.新增.htaccess文件
vi /var/www/html/linux-dash/.htaccess
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /var/www/html/linux-dash/.htpasswd
Require valid-user
3.设置用户密码
[root@192 server]# htpasswd -c /var/www/html/linux-dash/.htpasswd testuser
New password:
Re-type new password:
Adding password for user testuser
4.重启服务