PHP open_basedir custom template path


Aug 5, 2004
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?


Quality Assurance Analyst
Staff member
Oct 2, 2010
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:

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:

echo "/usr/local/cpanel/etc/httptemplates/apache2_2/default" >> /etc/cpanelsync.exclude