标签:
一、安装程序和组件
系统为CentOS6.6
# yum install httpd php php-mysql php-gd mysql mysql-server rsyslog-mysql
二、准备相关配置并测试环境
1、启动http,mysql服务
# service mysqld start
# chkconfig mysqld on
# service httpd start
# chkconfig httpd on
# vim /var/www/html/index.php
2、创建数据库,新建用户并授权
# rpm -ql rsyslog-mysql =>查看安装生成的文件获取createDB.sql位置
mysql < /usr/share/doc/rsyslog-mysql-5.8.10/createDB.sql ==>创建rsyslog的数据库和表
mysql> grant all on Syslog.* to sl@127.0.0.1 identified by ‘slpass‘; ==>新建账户并授权
mysql> grant all on Syslog.* to sl@localhost identified by ‘slpass‘;
mysql> flush privileges;
三、配置rsyslog
1、vim /etc/rsyslog.conf
2、在#### Modules #####启用模块:
$ModLoad ommysql ==>在配置文件添加
3、在####rules####段中定义记录日志信息于数据库中
facility.priority :ommysql:SERVER_IP,DATABASE,USERNAME,PASSWORD
*.info;mail.none;authpriv.none;cron.none :ommysql:127.0.0.1,Syslog,sl,slpass ==>在配置文件修改
# service rsyslog restart
# yum -y reinstall zsh
四、安装loganalyzer(loganalyzer-3.6.5)
# tar xf loganalyzer-3.6.5
# cp /var/www/html/loganalyzer-3.6.5/contrib/* /var/www/html//
# cd /var/www/html/
# chmod +x configure.sh secure.sh
# ./configure.sh
# ./secure.sh
# chmod 666 config.php
# chown -R apache.apache ./*
rsyslog日志存储于MySQL中
标签:
原文地址:http://www.cnblogs.com/kwstars/p/e57935cc5fa1c4cc3d21f6aa7eb6f478.html