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.

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:
    145
    Likes Received:
    2
    Trophy Points:
    18
    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:
    212
    Likes Received:
    3
    Trophy Points:
    18
    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.
     
  3. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    145
    Likes Received:
    2
    Trophy Points:
    18
    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:
    212
    Likes Received:
    3
    Trophy Points:
    18
    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.
     
Loading...

Share This Page