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.

easyapache post-script ?

Discussion in 'EasyApache' started by consultorpc, Aug 31, 2010.

  1. consultorpc

    consultorpc Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    Is there any way to exec a script after exec easyapache ?

    TIA.
     
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Script hook

    This is available via an EasyApache script hook. The following section of our documentation explains how to do this:

    EasyApacheHooks < EasyApache3 < TWiki

    For a complete list of the script hooks available in the rest of cPanel, not only EasyApache, please see the following:

    cPanel/WHM Script Hooks
     
  3. consultorpc

    consultorpc Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2003
    Messages:
    51
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    I've created the posteasyapache script with the proper permissions:

    Code:
    # ls -lh /scripts/posteasyapache 
    -rwxr-xr-x  1 root root 107 Aug 31 19:08 /scripts/posteasyapache*
    My script looks like this:

    Code:
    #!/bin/bash
    
    chown nobody:nobody /usr/local/apache/htdocs/index.php
    rm /usr/local/apache/htdocs/index.html
    
    I tried to run easyapache but it looks like the script wasn't run as the owners of index.php, for example, were still root:root.

    Am i doing something wrong?
     
Loading...

Share This Page