CentOS uses Rsyslog + LogAnalyzer + MySQL to deploy the log server

Source: Internet
Author: User
Tags rsyslog

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.