标签:
[root@localhost ~]# grep -v ‘^#‘ /etc/rsyslog.conf|grep -v ‘^$‘ $ModLoad ommysql *.* :ommysql:localhost,Syslog,rsyslog,123456 $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 $ModLoad imudp $UDPServerRun 514 $ModLoad imtcp $InputTCPServerRun 514 $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $template DynamicFile,"/var/log/ttlogs/%$YEAR%/%$MONTH%/%$DAY%/%fromhost-ip%-test.log" *.* ?DynamicFile $IncludeConfig /etc/rsyslog.d/*.conf *.info;mail.none;authpriv.none;cron.none /var/log/messages authpriv.* /var/log/secure mail.* -/var/log/maillog cron.* /var/log/cron *.emerg * uucp,news.crit /var/log/spooler local7.* /var/log/boot.log [root@localhost ~]# # /etc/init.d/rsyslog restart #重启下rsyslog的服务 #chkconfig rsyslog on #设置开机启动 # netstat -tpnl #检查rsyslogd服务是否正常启动,514端口 #logger ‘test_samcao‘ #发送测试日志测试 #tail -f /var/log/messages #查看是否有测试信息,上面的有添加mysql的接口,会有错误提示但不影响
#yum -y install httpd mysql mysql-server php php-mysql postgresql postgresql-server php-postgresql php-pgsql php-devel gd gd-devel php-gd #/etc/init.d/httpd start #/etc/rc.d/init.d/mysqld start #/usr/bin/mysqladmin -u root password ‘new-password‘
三、安装好Loganalyzer日志web
#wget http://download.adiscon.com/loganalyzer/loganalyzer-3.6.5.tar.gz #tar zxvf loganalyzer-3.6.5.tar.gz #cd loganalyzer-3.6.5 # mkdir -p /var/www/html/loganalyzer # rsync -a src/* /var/www/html/loganalyzer/ # touch /var/www/html/loganalyzer/config.php # chmod 666 /var/www/html/loganalyzer/config.php
[root@logserver ~]# cat /var/www/html/.htaccess AuthName "Login" AuthType basic AuthUserFile "/var/webuser" require valid-user [root@logserver ~]#
[root@localhost ~]# grep -v ‘^#‘ /etc/rsyslog.conf |grep -v ‘^$‘ $ModLoad imuxsock # provides support for local system logging (e.g. via logger command) $ModLoad imklog # provides kernel logging support (previously done by rklogd) $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $IncludeConfig /etc/rsyslog.d/*.conf *.info;mail.none;authpriv.none;cron.none /var/log/messages authpriv.* /var/log/secure mail.* -/var/log/maillog cron.* /var/log/cron *.emerg :omusrmsg:* uucp,news.crit /var/log/spooler local7.* /var/log/boot.log module(load="imfile" PollingInterval="10") input(type="imfile" File="/usr/local/u-mail/service/nginx/logs/access.log" StateFile="/var/spool/rsyslog/statefile1" Tag="tag1" Severity="access" Facility="local7") local7.* @192.168.1.213:514 *.* @192.168.1.213 [root@localhost ~]#
rsyslog+mysql+loganalyzer搭建日志服务器<个人笔记>
标签:
原文地址:http://www.cnblogs.com/drgcaosheng/p/5832697.html