There are two easy steps to activate, install or enable mod_rewrite for Apache 2.2 Web Server. Go in the Command line of your linux. It doesn't matter where you are in the folder structure, but you should either be the root or put sudo infront of the commands, like below to switch to the root user.
1. Type below command and hit enter
sudo a2enmod rewriteA successful response should be:
Enabling module rewrite. Run '/etc/init.d/apache2 restart' to activate new configuration!
2. Restart Apache2.2
/etc/init.d/apache2 restartAgain, use sudo in front of the command, if you not logged in as root user.
You could also use:
/etc/init.d/apache2 stop /etc/init.d/apache2 startIf you have problems in Linux RedHat you might want to try:
Problem: /etc/init.d/apache2 command not found
Another command that could work instead is:
sudo service apache2 restartAnother reason for this error message is that you might not have installed apache2 properly. In this case it helps to delete the old installation and run a clean install via.
sudo apt-get install apache2
Problem: /etc/init.d/apache2 permission denied
If you are not the root user run:
sudo /etc/init.d/apache2 restartThe instructions might also work for other Debian versions and other Linux destributions like Open Suse Linux, Ubuntu, RedHat etc. Let me know if you have problems with the instructions.