Categories
HowTos Linux Troubleshootings

How to enable mod_rewrite module in apache2.2 on Ubuntu/Debian/backtrack 5

BackTrack 5 is the most popular Penetration testing among Security Analysts. We have also been using it for a very long time.

Today we were testing one application on our back track 5 Linux. It has Apache installed but with a limited modules. I couldn’t access any page of my application because all URLs were rewritten using mod_rewrite. I performed following troubleshooting and finally installed mod_rewrite module.

mod_rewrite module is actually available under back track 5 Linux, but you 
have to just activate it.

How to check module if it is already available?

Module path :
ls -l /usr/lib/apache2/modules/mod_rewrite.so

Module config path :
ls -l /etc/apache2/mods-available/rewrite.load

How to Enable mod_rewrite now?

a2enmod rewrite

Output :
Enabling module rewrite.
Run ‘/etc/init.d/apache2 restart’ to activate new configuration!

Restart Apache
/etc/init.d/apache2 restart

Test you application, all URLs that is rewritten should work now!