MySQL binary log rotation
Posted on January 18, 2007 on 1:56 pm by glen | In General, MySQL, RedHat | No CommentsWe are running a MySQL replication setup, and find that the binary logs get very large, very quickly. Since MySQL didn’t come with a log rotation script, we rolled our own. Usage is simple:
At the top of the script are some definitions that you need to change for your setup:
- MYSQL_USER MYSQL_PASS - You will need to create a user in MySQL that has the RELOAD and SUPER privileges
- MYSQL_HOST - Where your MySQL server is located
- MYSQL_LOG_PATH MYSQL_LOG_NAME - where your binary logs are kept, and what they are called
- MYSQL_SLOW_LOG_NAME - the name of your slow log file
- MAX_LOG_DAYS - the number of days worth of old logs that you want to keep
Once you’ve configured these values, whack the script into cron and run it daily.
Apple QuickTime RTSP Buffer Overflow
Posted on January 8, 2007 on 9:30 am by glen | In General, Mac, Security | No CommentsA vulnerability has been found in the way QuickTime handles Real Time Streaming Protocol URL’s. Until Apple release a Software Update for this, it is recommended that users disable QuickTime support in their browsers. This is simple to do:
- Navigate to /Library/Internet Plug-Ins
- Drag the QuickTime Plugin.plugin and QuickTime Plugin.webplugin files to a temporary location, perhaps into your Documents folder
- Restart any open browsers, i.e. Safari, Firefox, Opera etc.
More information on this vulnerability can be found here:
Preventing Apache DOS attacks
Posted on January 2, 2007 on 1:32 pm by glen | In General, Apache, RedHat | No CommentsWe’ve recently come under attack from denial-of-service (DOS) attacks. In order to alleviate this situation, we are currently testing out the mod_evasive Apache module.
The install was simple. After downloading and unpacking the source code…
/usr/sbin/apxs -i -a -c mod_evasive20.c
This will compile the module, copy it to the correct directory and enable the module in your Apache config. In addition, we added the following options to our httpd.conf:
<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 2
DOSSiteCount 50
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
DOSEmailNotify glen@designsolution.co.uk
</IfModule>
Now, if too many requests come in from an IP address, the server will respond with a HTTP 403 response. This helps to save on bandwidth and reduce CPU load. Ideally, we would like to hook this into our firewall… our investigations are on-going!