Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Web Servers»Apache»How to Enable Event MPM in Apache 2.4 on CentOS/RHEL 7

    How to Enable Event MPM in Apache 2.4 on CentOS/RHEL 7

    RahulBy RahulMarch 1, 20152 Mins Read

    Apache MPM (Multi-Processing Modules) are Apache modules for creating child processes in Apache. There are many Apache MPM available, Each of them works in his own way. If you are using default Apache installation, Apache will use Prefork MPM by default.

    Event MPM is launched with many improvements from worker MP. I prefer to use the Event MPM which is an improvement over the Worker MPM. Event MPM is that Event has a dedicated thread which handles all Keep Alive connections and requests.

    This article will help you to Disable Prefork MPM and Enable Event MPM on Apache 2.4 running on your Linux operating system.

    Enable Event MPM in Apache

    First edit Apache MPM configuration file in your favorite text editor.

    # vim /etc/httpd/conf.modules.d/00-mpm.conf
    

    Comment LoadModule line for mpm_prefork_module, mpm_worker_module and Un comment LoadModule line for mpm_event_module in configuration as per showing below.

    #LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    #LoadModule mpm_worker_module modules/mod_mpm_worker.so
    
    LoadModule mpm_event_module modules/mod_mpm_event.so 
    
    

    enable event mpm

    After making above changes just restart your Apache servers.

    # systemctl restart httpd
    

    Check Active MPM in Apache

    Now you have successfully enabled Event MPM in your Apache server. To verify current MPM enabled on your server use following command.

    [[email protected] ~]# httpd -V | grep MPM
    
    Server MPM:     event
    
    Apache Event Modules MPM
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Allow SSH/FTP Access Based on Country using GeoIP
    Next Article List of Ports to Open for WHM & cPanel Server ?

    Related Posts

    How to Install Apache ActiveMQ on Ubuntu 22.04

    3 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    How To Disable HTTP Methods in Apache

    Updated:December 31, 20212 Mins Read

    How To Setup Apache, PHP & MongoDB in Ubuntu & Debian

    Updated:October 8, 20213 Mins Read

    Common Apache Commands on Ubuntu & Debian

    4 Mins Read

    How to Install and Secure Apache on Debian11

    6 Mins Read

    4 Comments

    1. Ankit on November 1, 2019 10:33 am

      I will thinking to change module prefork to module event/worker. but if any reflect to current project?

      Reply
    2. Pradip on January 30, 2017 6:24 am

      How to Check default parameters of prefork worker and event mpm and how to change these.

      Reply
    3. Pete Long on January 13, 2016 4:19 pm

      Hi If I do this Apache fails and will not start till I change it back? (CentOS7)

      [[email protected] ~]# service httpd status
      Redirecting to /bin/systemctl status httpd.service
      ● httpd.service – The Apache HTTP Server
      Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
      Active: failed (Result: exit-code) since Wed 2016-01-13 11:10:50 EST; 3min 19s ago
      Docs: man:httpd(8)
      man:apachectl(8)
      Process: 151 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
      Process: 122 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
      Main PID: 122 (code=exited, status=1/FAILURE)

      Jan 13 11:09:44 pnl-server1.petenetlive.com systemd[1]: httpd.service failed.
      Jan 13 11:10:50 pnl-server1.petenetlive.com systemd[1]: Starting The Apache HTTP Server…
      Jan 13 11:10:50 pnl-server1.petenetlive.com httpd[122]: AH00526: Syntax error on line 31 of /etc/httpd/conf.d/php.conf:
      Jan 13 11:10:50 pnl-server1.petenetlive.com httpd[122]: Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration
      Jan 13 11:10:50 pnl-server1.petenetlive.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
      Jan 13 11:10:50 pnl-server1.petenetlive.com kill[151]: kill: cannot find process “”
      Jan 13 11:10:50 pnl-server1.petenetlive.com systemd[1]: httpd.service: control process exited, code=exited status=1
      Jan 13 11:10:51 pnl-server1.petenetlive.com systemd[1]: Failed to start The Apache HTTP Server.
      Jan 13 11:10:51 pnl-server1.petenetlive.com systemd[1]: Unit httpd.service entered failed state.
      Jan 13 11:10:51 pnl-server1.petenetlive.com systemd[1]: httpd.service failed.
      Hint: Some lines were ellipsized, use -l to show in full.
      [[email protected] ~]# nano /etc/httpd/conf.d/php.conf
      [[email protected] ~]#
      [[email protected] ~]#
      [[email protected] ~]# nano /etc/httpd/conf.modules.d/00-mpm.conf
      [[email protected] ~]# service httpd start
      Redirecting to /bin/systemctl start httpd.service
      [[email protected] ~]# service httpd status
      Redirecting to /bin/systemctl status httpd.service
      ● httpd.service – The Apache HTTP Server
      Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
      Active: active (running) since Wed 2016-01-13 11:16:22 EST; 5s ago
      Docs: man:httpd(8)
      man:apachectl(8)
      Process: 151 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
      Main PID: 710 (httpd)
      Status: “Processing requests…”
      CGroup: /system.slice/httpd.service
      ├─710 /usr/sbin/httpd -DFOREGROUND
      └─712 /usr/sbin/httpd -DFOREGROUND

      Reply
      • furriephillips on February 4, 2021 10:56 am

        I had the same, but when checking the apache config for syntax errors, I got this

        # apachectl configtest
        AH00526: Syntax error on line 34 of /etc/httpd/conf.d/php.conf:
        Invalid command ‘php_value’, perhaps misspelled or defined by a module not included in the server configuration

        and the httpd server started up fine, after I’d commented out the 3 lines with that problem config variable

        #
        # Apache specific PHP configuration options
        # those can be override in each configured vhost
        #
        #php_value session.save_handler “files”
        #php_value session.save_path “/var/lib/php/session”
        #php_value soap.wsdl_cache_dir “/var/lib/php/wsdlcache”

        Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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