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!

PHP open_basedir custom template path

Discussion in 'General Discussion' started by Danik, Mar 4, 2011.

  1. Danik

    Danik Member

    Joined:
    Aug 5, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    151
    I need to add custom folder that will be excluded from openbase_dir restriction to all users

    1 I've edited /var/cpanel/templates/apache2/vhost.default and added my custom folder path
    2 I've rebuilded apache conf with /scripts/rebuildhttpdconf and in httpd.conf custom path was added ok
    3 I've restarted apache /scripts/restartsrv_apache and all works great

    But have found that after editing list trough WHM >> Main >> Security Center >> PHP open_basedir Tweak all
    WHM do not take my edited template from /var/cpanel/templates/apache2/vhost.default and builds vhosts without taking my changes and It does rebuild all vhosts after any changes in WHM

    To resolve this I should run /scripts/rebuildhttpdconf and /scripts/restartsrv_apache

    Is there any other template file, what I need to edit to resolve this issue?
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    First of all, /var/cpanel/templates/apache2/vhost.default should not be edited directly. That file will be wiped on cPanel forced updates. Instead, you would need to copy it to vhost.local and edit vhost.local instead:

    Code:
    cp /var/cpanel/templates/apache2/vhost.default /var/cpanel/templates/apache2/vhost.local
    Next, the template files used for new account creations are at /usr/local/cpanel/etc/httptemplates/apache2_2/ location where default is the http template (port 80) and ssldefault is the https template (port 443). If you edit the default file to make changes, you will need to put that file in the exclude list for cPanel updates:

    Code:
    echo "/usr/local/cpanel/etc/httptemplates/apache2_2/default" >> /etc/cpanelsync.exclude
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Danik

    Danik Member

    Joined:
    Aug 5, 2004
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    151
    Thank you. It was useful.
     
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