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.

Selectively allow config variables through ini_set?

Discussion in 'CloudLinux' started by iso99, Mar 30, 2016.

  1. iso99

    iso99 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    87
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I'm using Apache, Cloudlinux and mod_lsapi on my servers. I know ini_set is required by some apps that's why I can't disable it globally.

    Is there a way to allow ini_set but disallow it on some configurations, for example max_execution_time? Or just a way to override it (again) on execution?

    I know php_admin flag on Apache global conf can do this if not using suphp.

    Basically, I'm looking into any possible method. Config file or brute overriding on execution time, or if there's a better way to do it?

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,734
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. iso99

    iso99 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    87
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    EDIT: Sorry, I missed that part, lsapi does allow php_admin flag. Thanks!


    Hi Michael,

    Yes, I'm using both lsapi and CL. Thanks for the links but that's not what I'm trying to accomplish.

    I want to allow users to set limits using ini_set or any other way, but they shouldn't be able to override execution time.

    I don't think there's a way to do this, is it?
     
    #3 iso99, Mar 30, 2016
    Last edited: Mar 30, 2016
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,734
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Does this address your concerns, or are you still unable to prevent users from overriding specific values?

    Thank you.
     
  5. iso99

    iso99 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    87
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Apache post virtualhost global config did allow this value (wrapped in an IfModule), however it did not work globally. The workaround I found is that you included it in every virtualhost directive instead of globally inserting it. I haven't tested this yet and I still haven't found away to do this automatically instead of appending it for every virtualhost in httpd.conf. Let me know if cPanel has a way for this. Thanks.

    EDIT: Found this Modify Virtualhost Containers With Include Files - EasyApache - cPanel Documentation and will try it shortly. Sorry, I'm handling multiple tasks :(
     
  6. iso99

    iso99 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    87
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    EDIT:

    Finally got it to work.

    Steps to replicate (tested on indiv virtualhost first, will try global later):

    1. Wrap in <IfModule lsapi_module></IfModule> instead of mod_suphp.c or mod_php5.c

    2. Do distiller > How to edit all vhost on cpanel

    3. Try using phpinfo() and ini_set, should return false

    ---------

    Question:

    There seems to be no directive in httpd.conf for global /usr/local/apache/conf/userdata/$includename.conf? Should this be added automatically after distiller?
     
    #6 iso99, Apr 5, 2016
    Last edited: Apr 5, 2016
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,734
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You do not have to use the Apache distiller when following the guidelines at:

    Modify Virtualhost Containers With Include Files - EasyApache - cPanel Documentation

    Simply create the "/usr/local/apache/conf/userdata/$includename.conf" file (changing "$includename" to whatever file name you prefer) and rebuild the Apache configuration file via:

    Code:
    /scripts/rebuildhttpdconf
    Thank you.
     
Loading...
Similar Threads - Selectively allow config
  1. melloman
    Replies:
    3
    Views:
    734

Share This Page