I will show you howto install PSAD on Ubuntu 8.04 LTS server to block DDOS attacks (distributed denial of service) and port scan.
PSAD scan iptables log file to generate the attack block. The problem is that when you log ALL packets as shown in other PSAD tutorials, it will slow down considerably your server if it's busy and generate huge huge log files (growing at a rate of 1meg per second or more). With simple iptables rules, we will only log traffic that look suspicious (5 new connection in 5 second for example).