Saturday, September 28, 2013

Enable and Disable Apache modules

Enable and Disable Apache modules in Ubuntu or CentOS

If you want to enable or disable any module in Apache, this post may be helpful for you.

Enable or Disable Apache module in RHEL or CentOS

In CentOS, we can see all Apache modules in the directory /etc/httpd/modules.
These modules are enabled in the file httpd.conf using following code. 
Here is an example of rewrite module.
LoadModule rewrite_module modules/mod_rewrite.so
If you want to disable this module, just comment the line and restart Apache, now it does not load the module.

If you want to enable it again, just uncomment the line and restart apache. 
Using this method we can enable and disable any module of Apache on CentOS.

Enable or Disable Apache module in LAMPP

The process in LAMPP in same as CentOS.
All modules are mentioned in the file /opt/lampp/etc/httpd.conf
If you want to disable any module, just comment the line and restart LAMPP, now it does not load the module.

If you want to enable it again, just uncomment the line and restart LAMPP. 
Using this method we can enable and disable any module of Apache in LAMPP.

Enable or Disable Apache module in Ubuntu

If you want to disable apache module in ubuntu-apache2, run following command
$ sudo a2dismod module_name

If you want to enable apache module in ubuntu-apache2, run following command
$ sudo a2enmod module_name

Suppose you want to disable or enable rewrite module, you should run :
$ sudo a2dismod rewrite $ sudo a2enmod rewrite



No comments:

Post a Comment