[SOLVED] Problem with Drupals Clean-URLs feature. Apache not allowing the rewrite

Hey guys!
I’m hoping I could get some help in getting the clean-urls feature to work with drupal. My setup is as follows:

Ubuntu 14.04.2
Virtualmin 4.18.gp
Apache 2.4.7
php 5.5.9

Everything works fine with the site except when it comes to linking to something is comes up as Page not found do to drupal using a clean URL but apache isn’t redirecting it properly. I have mod_rewrite enabled.
I’ve tried both adding:

RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^ index.php [L]

directly to the apache site conf file, as well as adding

AllowOverride All AccessFileName .htaccess

Which throws this error when I restart apache…

AccessFileName not allowed here Action 'configtest' failed.

even though I’ve placed it exactly where Drupal and Apache tell me to put it in the config file. Can anyone please help me? I need the URLs to work properly. Any help is appreciated.

-Andre

For anyone else who runs into this issue. simply paste the following code into a .htaccess file in the home directory /home/username

RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^ index.php [L]