How to activate and deactivate modules in apache

In this manual, we will explain how to activate and deactivate certain modules in your Apache server installation. You will see that it is very easy.

Before starting the tutorial, don't you have a Cloud Linux server on which you can install your Apache web server? Don't worry! With just one click, you can easily deploy it with SW Hosting.

cta:cloud_so

We recommend that you execute these instructions from a user account with administrator privileges. For example, the root user account.

1. Activate apache modules in Debian-based distributions

In this case, we will use the a2enmod command. It is only necessary to write it followed by the name of the module that you want to activate.

a2enmod modulename

2. Disable apache modules in Debian-based distributions

Deactivating a module is as easy as activating it. In this case, we will use the a2dismod command followed by the name of the module that we wish to deactivate.

a2dismod modulename

3. Activate and deactivate apache modules in distributions based on Redhat

If you work with a distribution based on **Redhat (CentOs, RHEL, Fedora, etc.) **you must edit the following configuration file. For example with the nano editor.

nano /etc/httpd/conf/httpd.conf

Inside the file, you will find the lines that begin with LoadModule, each of them referring to a different module.

  • To deactivate a module you must write a pad # at the beginning of the line.
  • To activate a module you must ensure that the line does not start with a pad.

Save the changes by pressing Control+O and exit the editor by pressing Control+X.

4. Restart the apache server

Finally, you must restart the apache server so that your changes may take effect.

  • For distributions based on Debian, write:
service apache2 restart
  • For distributions based on RedHat, write:
service httpd restart

Remember that if you do not yet have a Cloud Linux server on which you can install Apache, you can easily deploy it with SW Hosting.

cta:cloud_so


2024 SW Hosting. All rights reserved. The prices shown on the website do not include any applicable taxes.