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.

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:
    569
    Likes Received:
    15
    Trophy Points:
    18
    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.
     
  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:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

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

    Accounts::Create

    Thank you.
     
Loading...

Share This Page