In order to enable Clean URLs module on Drupal, an Apache server module named mod_rewrite has to be enabled. The following is the procedure to do it on Ubuntu which has LAMP installed using tasksel.
The mod_rewrite on Ubuntu LAMP is not enabled by default. It can be enabled by running the following command on the terminal.
sudo a2enmod rewrite
This will enable the mod_rewrite module on Apache. Now restart Apache server by running.
sudo /etc/init.d/apache2 restart
Now navigate to the /etc/apache2/mods-enabled directory and list the files. This directory will contain a file named rewrite.load. This means that the module has been installed properly.
Now open the file /etc/apache2/sites-enabled/000-default using your favorite editor.
To the file add the following lines:
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Now restart apache as stated earlier. This should enable the Clean URLs on Drupal. You can check by going to the Administration-> Site configuration-> Clean URLs page.
