CentOS uses Rsyslog + LogAnalyzer + MySQL to deploy the log server
1. Install and set the LAMP Environment
Yum-y install httpd mysql * php *
Ii. Install Rsyslog
Server:
Yum install rsyslog-mysql
Rsyslog-mysql: Transfers logs to the MySQL database
Mysql-u root-p1234 </usr/share/doc/rsyslog-mysql-5.8.10/createDB. SQL
Configure data Permissions
# Mysql-uroot-p
Mysql> grant all on Syslog. * to syslog @ localhost identified by 'syslog ';
Mysql> flush privileges;
Mysql> exit
Modify configuration file
More/etc/rsyslog. conf
#### MODULES ####
$ ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$ ModLoad imklog # provides kernel logging support (previously done by rklogd)
$ ModLoad immark # provides -- MARK -- message capability
### Mysql ####
$ ModLoad ommysql. so
*. *: Ommysql: localhost, Syslog, syslog, syslog
# Provides UDP syslog resume tion
$ ModLoad imudp
$ UDPServerRun 514
# Log file dynamic production of Log files
$ Template logfile, "/data/rsyslog/% fromhost-ip % _ % $ year % $ month % $ day %. log"
*.*? Logfile
Restart rsyslog
Service rsyslog restart
Client:
# Yum install rsyslog-y
Configure the rsyslog client to send local logs to the server
# Vi/etc/rsyslog. conf
Add the following content to the last line:
-------------------
*. * @ Rsyslog Server IP Address
Restart rsyslog
Service rsyslog restart
3. Install and deploy LogAnalyzer
# Wget http://download.adiscon.com/loganalyzer/loganalyzer-3.6.5.tar.gz
# Tar zxf loganalyzer-3.6.5.tar.gz
# Cd loganalyzer-3.6.5
# Mkdir-p/data/www/loganalyzer
Copy the loganalyzer source code to the loganalyzer directory under the apache DocumentRoot.
# Cp-r src/*/data/www/loganalyzer
# Cp-r contrib/*/data/www/loganalyzer
Before installing loganalyzer through the web wizard, you must first execute the following two scripts
# Cd/data/www/loganalyzer/
# Sh configure. sh
# Sh secure. sh
# Chown-R apache. apache/data/www/loganalyzer
WEB configuration
Http: // IP/loganalyzer
(Omitted)