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!

script to replace modsec2.conf after easyapache

Discussion in 'EasyApache' started by jimlongo, Nov 25, 2013.

  1. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    199
    Likes Received:
    8
    Trophy Points:
    68
    which script hook would be best to copy my custom modsec2.conf file when easy apache runs.

    Code:
    #!/bin/sh
    cp -f /root/config_backup/modsec2.conf /usr/local/apache/conf/modsec2.conf
    
    should I use the script 'posteasyapache' or 'before_httpd_restart_tests' ?
     
  2. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    218
    Likes Received:
    3
    Trophy Points:
    68
    Location:
    Indiana, USA
    Either one of those should work just fine IMHO. It just depends on whether you want it to run before the Apache tests during EasyApache or after EasyApache is completely done.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    199
    Likes Received:
    8
    Trophy Points:
    68
    Thanks Michael,

    Been thinking . . . wouldn't posteasyapache be too late as apache has already restarted?

    so I'm thinking before_ or after_httpd_restart_tests
     
  4. MikeDVB

    MikeDVB Well-Known Member
    PartnerNOC

    Joined:
    Jun 4, 2008
    Messages:
    218
    Likes Received:
    3
    Trophy Points:
    68
    Location:
    Indiana, USA
    I know that the LiteSpeed hook to build a matching PHP uses the before_httpd_restart_tests last I looked - so it's probably not a bad place to do it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice