Monthly Archives: May 2015

How to redirect single url in nginx?

We need to redirect something like: http://example.com/issue1 –> http://example.com/shop/issues/custom_isse_name1 http://example.com/issue2 –> http://example.com/shop/issues/custom_isse_name2 http://example.com/issue3 –> http://example.com/shop/issues/custom_isse_name3 this can be achieved in two ways: location /issue { rewrite ^/issue(.*) http://$server_name/shop/issues/custom_issue_name$1 permanent; } or location /issue1 { rewrite ^/.* http://$server_name/shop/issues/custom_issue_name1 permanent; } location /issue2 { rewrite ^.* http://$server_name/shop/issues/custom_issue_name2 permanent; }

Store Apache Logs into Amazon S3

his article explains how to use Fluentd’s Amazon S3 Output plugin (out_s3) to aggregate semi-structured logs in real-time. Table of Contents Background Mechanism Install Configuration Tail Input Amazon S3 Output Test Conclusion Learn More Background Fluentd is an advanced open-source log collector originally developed at Treasure Data, Inc. One of the main objectives of log… Read More »

Getting Data From Syslog Into S3 Using Fluentd

Here is how: $ gem install fluentd $ gem install fluent-plugin-s3 $ touch fluentd.conf fluentd.conf should look like this (just copy and paste this into fluentd.conf): <source> type syslog port 5140 bind 0.0.0.0 tag system.local </source> <match **> type s3 path <s3 path> #(optional; default=””) time_format <format string> #(optional; default is ISO-8601) aws_key_id <Your AWS… Read More »

HowTo: Rotate Logs to S3

HowTo: Rotate Logs to S3 This article will talk about how to use logrotate to rotate your logs to S3. Here we specifically are using Gentoo Linux, and we can find EC2 AMIs on the Gentoo in the Cloud page. We will be using s3cmd to actually move the files to S3, Configuration /etc/logrotate.conf This… Read More »