Basic CGI starts a new process to handle each request. This is
simple, but resource hungry. To make things more efficient, a number
of protocols have developed that keep a CGI server running in the
background. The frontend webserver then passes requests back to the
CGI server for processing without having to fire up a new program.

FastCGI is the original CGI server protocol, but here we'll focus
on it's simpler cousin SCGI. I write most of my scripts in
Python, so I use the handy scgi module to write the
server (www-apps/scgi on Gentoo). There's a great article on
Linux Journal to walk you through things, but in short, you need
something like: