Tag Archives: mod_rewrite

Apache mod ReWrite in Debian

Installing apache on a Debian server is quite easy. Just type:

sudo aptitude install apache2

But the previous command misses an important Apache module. The ModRewrite module. How do we install this module? There are two ways, the easy and the hard way. Lets explain the easy way first. Type:

sudo a2enmod rewrite && sudo /etc/init.d/apache2 restart

That’s it. Module installed and ready to go. Lets explain the hard way now.

sudo find /usr/lib -type f -name “mod_rewrite.so”

sudo vim /etc/apache2/mods-enabled/rewrite.load

Write the where the rewrite module is located, probably:

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

And finally:

sudo /etc/init.d/apache2 restart

Here is a small intro on how to use this module.

Enjoy.