Posts

Showing posts from February, 2013

How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog

How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog? MySQL database server generates binary log files for every transaction to the databases, provided administrator does not disable or comment out the “log-bin” parameter in my.cny configuration file. The binary log files are written in binary format. Although the binary logs, or also known as logbin are mainly used for MySQL database replication purpose, sometimes you may need to examine or read the contents of binary logs in text format, where the mysqlbinlog utility will come in handy. Binary log file, which normally has name with the format host_name-bin.xxxxxx and will be store in your data directory,  could not be opened and read straight away as it’s in unreadable binary format. To read the binary logs in text format, we can make use of mysqlbinlog command, which also able to readrelay log files written by a slave server in a replication setup. Relay logs have the same format as binary log files. ...

Show Real IP in Apache Access Log (CDN)

Image
Recently we have got some DDoS attacks on our FIREWALL and we want to find out the Source IP from where we were getting these attacks.  Since we are using CDN(Content Delivery Network) and maximum of static contents are being served from CDN. So we will not be able get source IPs in our logs and  we need to see the real IP to make sure we can do some log processing accurately. The Level3 CDN basically working like example below: Level 3 Edge Server will work as the reverse-proxy to cache the website contents from requests they received on their edge servers anywhere around the world. This will speed up the website loading page and decrease the server load of the web server. The only problem of this implementation is that you can only seen Level3,s IP connecting to your web server. As the web server has no information about the source IP unless the edge server (CDN provider) gives it a header on the HTTP request to specify it. Then we have asked LEVEL3 t...