2020-11-19

Experiment name: Configure log server experimenter HJSM Date 2020-11-19
Experiment purpose: Configure log server database log client dynamic upload server

Experimental topology:
Experimental environment: Operating system: Centos 7 two sets of
experimental equipment: Centos 7
experimental steps:

1. Configure the log server
Build LAMP on the log server
Insert picture description here

2. Set up the test page and test
[root@localhost html]# cd /var/www/html
[root@localhost html]# vim test.php
Insert picture description here

t@localhost html]# firefox http://127.0.0.1/test.php
Insert picture description here

3. Configure the log server database.
Insert picture description here

Insert picture description here

4. Configure the main configuration file of the server rsyslogd
[root@localhost rsyslog-8.24.0]# cd
[root@localhost ~]# vim /etc/rsyslog.conf
Insert picture description here

[root@localhost ~]# systemctl restart rsyslog.service
[root@localhost ~]# setenforce 0
5. Configure the log client
[root@localhost ~]# vim /etc/rsyslog.conf
Insert picture description here

[root@localhost ~]# systemctl restart rsyslog.service
6. Edit /etc/bashrc, write all commands executed by the client to the system log /var/log/messages, and add at the end of the document

[root@localhost ~]# vim /etc/bashrc
Insert picture description here

[root@localhost ~]# source /etc/bashrc
client use command
Insert picture description here

7Server monitoring log real-time information
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# tailf /var/log/messages

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_51167520/article/details/109818962