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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

question about apache 2.4 virtual host config

Discussion in 'EasyApache' started by LAZer, May 9, 2017.

  1. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    76
    Likes Received:
    1
    Trophy Points:
    58
    Location:
    at net :D
    Hi , I have finally migrated my server from centos 5.3 apache 2.2 cpanel 56 to cents 7.3 apache 2.4 cpanel 64.
    I have some problems in configuring virtual hosts as many configurations is changed.

    I used to have per user php.ini file outsite of users directory.
    I have read some pages regarding how to apply such a change in easyapache 2.4 :

    The cPanel PHPRC PHP Patch for EasyApache 4 - EasyApache 4 - cPanel Documentation
    PHP Handlers - EasyApache 4 - cPanel Documentation



    I currently have the setting of php 5.6 with fpm : off .
    the settings in /etc/suphp.conf in the part of [phprc_paths] settings are all commented. ( no active rules defined there. )
    when I use .user.ini in public_html directory of <cphostuser> some directives change , but some are ignored.
    for example I want to set File_uploads : off in multiphp ini editor , and have a restricted disable_functions , but allow them for some users via their own php.ini file.

    when i set file_uploads=on in public_html\.user.ini then i check phpinf() it does not change .
    but some other directives work for example display_errors=on works.

    then I set suphp_ConfigPath in .htacceass and copy a full php.ini to a directory and set its path here. it works fine and the "loaded configuration path" changes to this php.ini that I set.

    now I want to have this suphp_ConfigPath in the virtual host config of that user instead of .htaccess file that user may change it.

    as this link says :
    Modify Virtualhost Containers With Include Files - EasyApache - cPanel Documentation

    Without SSL /usr/local/apache/conf/userdata/std/2_4/$user/$includename.conf

    I put that php.ini code to this config
    /usr/local/apache/conf/userdata/std/2_4/<cphostuser>/user.conf

    then I update virtual host configs :
    /scripts/ensure_vhost_includes --user=cphostuser

    but It doesn't read the suphp code to change the php.ini address like what it does from .htaccess file.
    any solutions ?
     
  2. LAZer

    LAZer Well-Known Member

    Joined:
    Jan 18, 2010
    Messages:
    76
    Likes Received:
    1
    Trophy Points:
    58
    Location:
    at net :D
    from the comments in httpd.conf I could find the correct address for includes config .

    the address in 2_4 easyapache 4 is : /etc/apache2/conf.d/userdata/std/2_4/<username>/<user>.conf
    I used to place configs in /usr/local/apache/conf/userdata/std/2_4/
    which didn't work. but it worked in 2_2 and 2....
    maybe linking this directory to the new address fixes it . anyways I'll upload my configs to this new directory.

    also I could make it read suPHP_ConfigPath by using <Directory /home/<user>/public_html> command.


    <Directory /home2/<username>/public_html>
    suPHP_ConfigPath /home/ini/<username>/
    </Directory>
    and updating httpd config using script and restarting httpd. works. it completely changed the loaded configuration php.ini path in phpinfo of the user.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You can find the updated documentation on how to make changes to the Virtual Host include files with EasyApache 4 at:

    Modify Apache Virtual Hosts with Include Files - EasyApache 4 - cPanel Documentation

    Thank you.
     
Loading...

Share This Page