Simple! Just run the command

a2enmod rewrite

Restart Apache 2 by running the command

/etc/init.d/apache2 restart

Done!

...if you are still having problems getting mod_rewrite to work, check that the config file for the site (located in the directory /etc/apache/sites-available/) does not have "AllowOverride None". If it does then change it to AllowOverride All instead in order to allow mod_rewrite commands to be set in the .htaccess file.