• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue regarding http.include

Y

YoelM

Guest
Hi all

I'm having a problem with the template that generates the http.include... the point is that I need an specific path to be added on the line php_admin_value open_basedir

by default it always add
php_admin_value open_basedir /var/www/vhosts/mydomain.com/httpdos/:/tmp/

but i have to add manually an extra path at the end that is removed everytime that I update the system, or another change of configuration.

I haven't found that bloody template so I can edit it or at least force to not do it anymore

So is a pain to be doing it manually.

I appreciate so much your help


Yoel

by the way i have also the issue that the http.include is creating multiple instances http://forum.parallels.com/showthread.php?t=107013
 
you have to set things like that in a vhost.conf per domain. you can run a batch file every time you create a new domain in plesk with "plesk events" and write the vhost.conf for this specific domain. thats the way i handle this.
 
OK I see, although it will be a pain to program that, because the point is that now http.include is generated dynamically under a different name every time so it makes everything harder.


I still think the template will be the key to modify this files.

Thanks.

Any news about the template files?
 
lhwparis

Can you save me some time, putting some of your code to do this kind of task,

I will appreciate it

yoel
 
no its not. there is no template you can edit. the way to go is a vhost.conf file for each domain. thats the recommendet way to handle changes to your http config.

cant access it at the moment, i will try to post the code later.
 
I found the template...


/usr/local/psa/admin/conf/templates/default/sevice/php.php

I just add a patch to it, but i'm sure it will be replaced with the next plesk update... so anyway I will keep a copy of the file just to overwrite it in case the problem hasn't been sort out by the developers.

the code bellow got the amends commented

/usr/local/psa/admin/conf/templates/default/sevice/php.php



<IfModule <?php echo $VAR->server->webserver->apache->php4ModuleName ?>>
<?php
if ($OPT['enabled']) {
echo "php_admin_flag engine on\n";
if (!array_key_exists('safe_mode', $OPT) || $OPT['safe_mode']) {
echo "php_admin_flag safe_mode on\n";
} else {
echo "php_admin_flag safe_mode off\n";
}
if(array_key_exists('dir', $OPT) && $OPT['dir']) {

//changes start here

$linetoadd = ""; // initialize
if (strpos($OPT['dir'], 'mydomain.com')>0) // this line is to check only the domain I'm interested
$linetoadd = '':/new/location/iwant/"; // add the open_basedir path.

echo "php_admin_value open_basedir {$OPT['dir']}/:/tmp/".$linetoadd."\n"; // insert the variable at the end

//until here

}
} else {
echo "php_admin_flag engine off\n";
}
?>
</IfModule>

<IfModule mod_php5.c>
<?php
if (array_key_exists('enabled', $OPT) && $OPT['enabled']) {
echo "php_admin_flag engine on\n";
if (!array_key_exists('safe_mode', $OPT) || $OPT['safe_mode']) {
echo "php_admin_flag safe_mode on\n";
} else {
echo "php_admin_flag safe_mode off\n";
}
if(array_key_exists('dir', $OPT) && $OPT['dir']) {


//then here I repeat the same

$linetoadd = ""; // same
if (strpos($OPT['dir'], 'mydomain.com')>0) // as
$linetoadd = '':/new/location/iwant/"; // above

echo "php_admin_value open_basedir {$OPT['dir']}/:/tmp/".$linetoadd."\n";

// and now is finish

}
} else {
echo "php_admin_flag engine off\n";
}
?>
</IfModule>

enjoy it
still would like to see the solution with the events.
cheers
 
/usr/local/psa/admin/conf/templates/default/sevice/php.php - That path does not exist on my system. (Plesk 9.5.2 \ Fedora 11) Somebody, help me! I very need to find vhost template!
 
Back
Top