Fuuka is a program that that lets you archive 4chan imageboards.
It's written in Perl. It uses MySQL for its local database, CGI or mod_perl if you want a web interface and gnuplot to create graphs with statistics.
Check the wiki articles for the system requirements and advanced tips on how to run it.
Written from scratch by Andrey, all credit goes to him. Maintained by Eksopl from 2009-2013.