rsyslog日誌儲存於MySQL中

來源:互聯網
上載者:User

標籤:

一、安裝程式和組件系統為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 [email protected] identified by ‘slpass‘;        ==>建立賬戶並授權
mysql> grant all on Syslog.* to [email protected] 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中

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.