While working on Apache Module in Ubuntu,I found rewrite problem in Apache Web Server.I tried to enable the rewrite module but got this error ERROR: Module rewrite does not exist!.After troubleshooting,I found the problem was with mod_rewrite module.
After doing some more troubleshooting,it is found that the rewrite.load file was missing in /etc/apache2/mods-available/ .
Now,I checked the mod_rewrite.so actual module file and Wow it was there.
Below given is step by step command which I ran,to solve this issue.Here is the reference from my system
[email protected]:~# a2enmod rewrite ERROR: Module rewrite does not exist! [email protected]:~# ls -l /usr/lib/apache2/modules/mod_rewrite.so -rw-r--r-- 1 root root 58728 Jul 12 2013 /usr/lib/apache2/modules/mod_rewrite.so [email protected]:~# [email protected]:~# echo "LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so" > /etc/apache2/mods-available/rewrite.load [email protected]:~# [email protected]:~# a2enmod rewriteEnabling module rewrite. To activate the new configuration, you need to run: service apache2 restart [email protected]:~#
After this I restarted the apache2 service
sudo service apache2 restart
Problem is solved now.