Add the following line to your rtorrent config file, usually ~/.rtorrent.rc.

scgi_port = localhost:5050

Instead of using a tcp port, it is also possible to use a socket using the scgi_local option instead. This did not work for me, as lighttpd complained about permissions regardless of permissions / location of socket file.

lighttpd

After starting lighthttp as per the wiki, you should be able to access the test page at http://localhost:80.

By default the pages are served from /srv/http, this is where we will be putting rutorrent.

lighttpd.conf

Edit lighthttpd's config file, /etc/lighttpd/lighttpd.conf.

The following lines tell lighttpd to load the fastcgi and simple-cgi modules. Fast cgi is needed for rutorrent itself, and scgi for rutorrent to communicate with rtorrent.

server.modules += ( "mod_fastcgi" )
server.modules += ( "mod_scgi" )

We need to tell lighttpd how to treat files like css, images (jpg etc.), js. Otherwise it will not know what to do with them, and you may get a dialog to download the file or rutorrent will just not work properly.

Here is a long list of filetypes, it is probably overkill as most of them are not needed, but easier to cover them all.