Enable Clean Url in Drupal on Linux

1. Go to Terminal and type following commands

sudo a2enmod rewrite
sudo vi /etc/apache2/sites-enabled/default

If second command didn't work or it open a new file then try following command

sudo vi /etc/apache2/sites-enabled/000-default

2. Change (line 7 and line 11), "AllowOverride None" to "AllowOverride All".
Save and exit.
3. Restart Apache by following command.

sudo /etc/init.d/apache2 restart