Enabling Apache 2 mod_rewite on Ubuntu

Apache Logo

Trying to get some of my code running on a fresh Ubuntu install with an apt-get’d version of Apache I discovered things don’t run like they should.

It turns out the maintainers of the Apache package ship it in a less than ready to use state, the most notable I’ve found that mod_rewite is not enabled.

To get things back on track I enabled mod_rewrite a2enmod rewrite

Then I needed to edit the Apache configuration files to allow .htaccess overrides. Depending or your install these could be anywhere – I grepped and the relevant Dir entries where located here /etc/apache2/sites-enabled/000-default

Since this is a development server I wasn’t conservative and set it to all AllowOverride All

Then I just needed to restart Apache

service apache2 restart

too easy