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!

Automatically run /scripts/ensure_vhost_includes --all-users after account creation

Discussion in 'General Discussion' started by M373H, May 2, 2015.

  1. M373H

    M373H Member

    Joined:
    Jan 18, 2015
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm wondering if there is a way to make cPanel run the following commands automatically every time account is created:
    Code:
    /scripts/ensure_vhost_includes --all-users
    /etc/init.d/httpd restart

    If that is not possible, can I set a cronjob for the above commands to run hourly under user root?

    Thank you :)
     
  2. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    575
    Likes Received:
    20
    Trophy Points:
    93
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Is there a particular reason on why you would want to (or need to) do that?

    I suppose you could use a scripts hook to do this.

    However, it's not really necessary.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. M373H

    M373H Member

    Joined:
    Jan 18, 2015
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you for your reply,

    I wanted to restrict all users to a global php.ini file and also have the ability to create custom php.ini files for specific users. I followed the method in this thread by cPanelTristan However in order to restrict new created accounts to the global php.ini file, I have to run the above mentioned commands. I don't to want to do that manually every time account is created.

    That's why I'm looking for a way to automate the process.

    If there is a better way to restrict users to a global php.ini while being able to set custom php.ini files to specific users, please let me know :) I'm currently using PHP 5.4

    Thank you :)
     
    #3 M373H, May 2, 2015
    Last edited: May 2, 2015
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,633
    Likes Received:
    1,787
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You could use a post account creation script hook, as documented here:

    Accounts::Create

    Thank you.
     
    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