Topics

Solutions

Easy solutions and ideas found after long googling or hard coding

Dynamic Content Caching using Lighty + mod_magnet + lua

*Updated 11 Jan 2007 to include luazlib, fix lighty config file and add zlib decoding to cache.lua for older browsers
Since I read the documentations for mod_cml, I was very excited to use this module since caching using PHP running as FastCGI is not helping much during server peak load. However, mod_cml was replaced by mod_magnet which is more flexible and gives more control over request handling in Lighttpd. This Article will focus on caching your PHP scripts using Lua and mod_magnet under Lighttpd,

Using iptables to block ips that spam or attack your server

Check Configuring iptables on CentOS post.

Why should you do that while APF or CSF can do it automatically?
Because APF/CSF could block an important bot testing your server to add to search index. So reviewing every ip would be a daily task!
Ok, so how?
using RHEL4, centos4

get an array containing random integers between $min and $max integers

Trying to pick up random keys from an array but don’t want any duplicates?
try this

Using Google AJAX API to copy google results in array

This is some way you can get Google results as a JavaScript array that you can display on any page, you first need to get your Google API Key then try this code…

Get average server load

This function should work on Unix as on windows