Apr 15

Enable mod_rewrite on Apache

Simply, mod_rewrite is used for rewriting a URL at the server level, giving the user output for that final page. So, for example, a user may ask for http://www.somesite.com/widgets/blue/, but will really be given http://www.somesite.com/widgets.php?colour=blue by the server. Of course, the user will be none the wiser to this little bit of chicanery.

an Apache web server module installed on all of our Linux servers by default; it does not have to be installed or enabled. In case you haven’t isntalled it you can try this

# sudo a2enmod rewrite

Enable mod_headers on Apache

For customization of HTTP request and response headers, you should enable mod_headers on Apache.

sudo a2enmod headers

Enable mod_expires on Apache
a module that allows you to set a given period of time to live for web pages and other objects served from web pages. The idea is to inform proxies like Squid and web browser how often they should reload objects from the server. This will have you bandwidth and server load, because clients who follow the header will reload objects less frequently.

# sudo a2enmod expires

Then reload your apache
# /etc/init.d/apache2 force-reload

One Response to “How to enable modules on Apache in Ubuntu”

  1. Adityo Says:

    My pleasure 🙂

Leave a Reply