Skip to main content

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

Comments

3 comments

  • cPanelPeter cPanel Staff
    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.
    0
  • M373H
    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.

    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.
    Two Important Notes on Above Method 2. New accounts aren't restricted Any accounts created after you have locked users into the global php.ini file using the tags around suPHP_ConfigPath in userdata location will not be restricted to it. Each time a new account is created, the following must be run after the account creation to lock that account to the global restriction:
    /scripts/ensure_vhost_includes --all-users /etc/init.d/httpd restart

    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 :)
    0
  • cPanelMichael
    Hello, I'm wondering if there is a way to make cPanel run the following commands automatically every time account is created:
    /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 :)

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

Please sign in to leave a comment.