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