To install mod-rewrite in debian type a2enmod rewrite from the shell. You will the be asked to restart apache.
A simple mod-write script that blocks anyone from hotlinking to your images would look like this:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]
You would either place this in an .htaccess file or if you have root access to the server in /etc/apache2/sites-available and then within the directory you want to protect from hotlinking.