Close Menu
    Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Web Servers»Apache»How to enable or disable Apache2 Modules

    How to enable or disable Apache2 Modules

    By RahulApril 19, 20222 Mins Read

    Apache2 is a most popular web server used in Linux operating systems. Apache is a modular web server where each functionality is served by specific modules. To add or remove any specific functionality to the Apache server we can simply enable or disable the corresponding module.

    All the Apache2 modules are stored under /etc/apache2/mods-available/ directory. Once we enable any module it makes a soft link to /etc/apache2/mods-enabled/ directory. The same process reverses, once we disable any module.

    In this tutorial, you will learn about enabling and disabling Apache2 modules on Debian-based systems.

    1. Enable Apache2 Module

    We use a2enmod command to enable modules in Apache2 web server. For example, if we need to enable the Apache rewrite module use the following command.

    sudo a2enmod rewrite 
    

    Then reload the Apache configuration.

    sudo systemctl relaod apache2 
    

    2. Disable Apache2 Module

    Similarly to disable module we use a2dismod command. For example, if we need to disable the Apache rewrite module use the following command.

    sudo a2dismod rewrite 
    

    Then reload the Apache configuration.

    sudo systemctl relaod apache2 
    

    3. Check Modules Status

    Check the status of the specific module using the a2query command. For example to find the current status of the rewrite module run the below command.

    sudo a2query -m rewrite 
    
    Output
    rewrite (enabled by site administrator)

    4. List Apache2 Modules

    To list all available Apache2 modules with the status, use the following command. The output will differ system to system.

    sudo a2query -m 
    
    Output
    autoindex (enabled by maintainer script) mpm_prefork (enabled by maintainer script) authn_file (enabled by maintainer script) proxy (enabled by site administrator) authz_svn (enabled by maintainer script) dav (enabled by maintainer script) ... ... dav_svn (enabled by maintainer script) proxy_http (enabled by site administrator) authz_user (enabled by maintainer script) filter (enabled by maintainer script) access_compat (enabled by maintainer script) setenvif (enabled by maintainer script)

    That’s it. Assuming this tutorial gives you little understanding about modules management in Apache2 web server.

    Apache Modules
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Enable Server Side Include (SSI) in Apache

    How To Enable Server Side Includes (SSI) in Apache

    How to Enable Caching in Apache

    Installing Tomcat 10

    How to Install and Configure Tomcat 10 on Ubuntu 22.04

    View 4 Comments

    4 Comments

    1. Ribamar FS on February 12, 2021 10:38 am

      Thank you.

      Reply
    2. David Smith on March 13, 2018 8:54 pm

      On Ubuntu17.10, I loaded apache2, php5, MySQL, and Moodle…. Within the network things work just fine…. Externally traffic is not getting to the apache server… Internally the ipaddress will pull up the Moodle pages…. Localhost does not nor does the FQDN internally or externally. One tech thought it might be the url rewrite, or the mod_dir… but I am not sure… It is pulling up by the IP just fine internally, but not externally.

      Reply
      • Rahul K. on March 14, 2018 4:25 am

        Hi David,

        What are the Apache configurations?

        Reply
    3. Asdaq on September 22, 2017 8:23 am

      Plz tell the function of enable/disable rewrite module. What are the pro/cons.

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Find Objects Between Two Dates in MongoDB: A Practical Guide
    • How to Check Packages Update History in Ubuntu
    • How to Grep for Contents after a Matching Pattern
    • How to Change Port in Next.Js
    • Ubuntu 24.04 LTS: The Future of Open-Source Excellence
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.