Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Installing MPM-Event and OWASP ModSecurity Core Rule Set V3.0 through command line

Discussion in 'Security' started by Sarath Kumar R, Apr 29, 2017.

Tags:
  1. Sarath Kumar R

    Sarath Kumar R Active Member

    Joined:
    Oct 18, 2016
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Guys I am automating server hardening and optimization,

    1) for that I need to install OWASP ModSecurity Core Rule Set V3.0 from the command line.
    2) Also, I need to install MPM event through command line. Current EA4 profile is CPanel default.

    Please let me know the solution or workarounds for the same
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can manage Mod Security vendors through the following command:

    Code:
    /usr/local/cpanel/scripts/modsec_vendor
    You can follow the steps documented at:

    Multi-Processing Modules - MPMs - EasyApache 4 - cPanel Documentation

    Thank you.
     
  3. Sarath Kumar R

    Sarath Kumar R Active Member

    Joined:
    Oct 18, 2016
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You can use these commands:

    Code:
    yum shell
    remove ea-apache24-mod_mpm_prefork
    install ea-apache24-mod_mpm_event
    run
    Thank you.
     
  5. Sarath Kumar R

    Sarath Kumar R Active Member

    Joined:
    Oct 18, 2016
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    @cPanelMichael thank you for the info.

    But we were trying to automate MPM upgrade to event via script (bash script) and we are facing the issue, when the script executes yum shell and will wait for the next commands as the bash is not able to pass the remaining commands to yum shell. Please let me know is there any alternative for the same.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You could also use a command like this:

    Code:
    yum swap ea-apache24-mod_mpm_prefork ea-apache24-mod_mpm_event 
    Thank you.
     
  7. Sarath Kumar R

    Sarath Kumar R Active Member

    Joined:
    Oct 18, 2016
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    @cPanelMichael I have tried the above command and got the below error"

    ==
    prntscr.com/f6ke34
    ==

    Any idea why swap is not working with yum.


    upload_2017-5-11_17-2-11.png


    root@server [~]# rpm -qa | grep -i yum
    yum-cron-3.2.29-81.el6.centos.noarch
    yum-plugin-fastestmirror-1.1.30-40.el6.noarch
    yum-utils-1.1.30-40.el6.noarch
    yum-metadata-parser-1.1.2-16.el6.x86_64
    yum-3.2.29-81.el6.centos.noarch
    yum-plugin-universal-hooks-0.1-9.9.1.cpanel.x86_64

    upload_2017-5-11_17-2-53.png
     
    #7 Sarath Kumar R, May 11, 2017
    Last edited by a moderator: May 11, 2017
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  9. Sarath Kumar R

    Sarath Kumar R Active Member

    Joined:
    Oct 18, 2016
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
  10. Anoop P Alias

    Anoop P Alias Well-Known Member

    Joined:
    Mar 31, 2015
    Messages:
    76
    Likes Received:
    10
    Trophy Points:
    8
    Location:
    Kochi,Kerala,India
    cPanel Access Level:
    Root Administrator
    you can also try

    rpm -e --nodeps ea-apache24-mod_mpm_prefork && yum install ea-apache24-mod_mpm_event
     
  11. Sarath Kumar R

    Sarath Kumar R Active Member

    Joined:
    Oct 18, 2016
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    @Anoop P Alias thanx for the help.

    Please refer the below snippet for the exact steps to automate mpm upgrade from to event via bash

    ==
    #!/bin/bash
    cp -rp /etc/yum.conf /etc/yum.conf_bak
    sed -i '2i assumeyes=1' /etc/yum.conf
    cat > /root/mpm.txt <<EOF
    remove ea-apache24-mod_mpm_prefork
    install ea-apache24-mod_mpm_event
    run
    EOF
    yum shell /root/mpm.txt
    sed -i '2d' /etc/yum.conf
    rm -rf /root/mpm.txt
    sleep 2;
    clear
    ==
     
    cPanelMichael likes this.
Loading...

Share This Page