2020-11-19
实验名称: 配置日志服务器 实验人 HJSM 日期 2020-11-19
实验目的: 配置日志服务器数据库日志客户端动态上传服务器
实验拓扑:
实验环境: 操作系统:centos 7 两台
实验器材: Centos 7
实验步骤:
1、配置日志服务器
在日志服务器上构建LAMP
2、设置测试页并测试
[[email protected] html]# cd /var/www/html
[[email protected] html]# vim test.php
[email protected] html]# firefox http://127.0.0.1/test.php
3、配置日志服务器数据库。
4.配置服务器rsyslogd的主配置文件
[[email protected] rsyslog-8.24.0]# cd
[[email protected] ~]# vim /etc/rsyslog.conf
[[email protected] ~]# systemctl restart rsyslog.service
[[email protected] ~]# setenforce 0
5.配置日志客户端
[[email protected] ~]# vim /etc/rsyslog.conf
[[email protected] ~]# systemctl restart rsyslog.service
6、编辑/etc/bashrc,将客户端执行的所有命 令写入系统日志/var/log/messages中,在 文档末尾添加
[[email protected] ~]# vim /etc/bashrc
[[email protected] ~]# source /etc/bashrc
客户机使用命令
7服务器监控日志实时信息
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# tailf /var/log/messages