Piwik-latestreferrers is a project mainly written in PHP, it's free.
Piwik Plugin to analyze the latest referrers to a website
404: Not Found