[BUG GUI] open_basedir and PHP-FPM

interfasys

Verified User
Joined
Oct 31, 2003
Messages
1,821
Location
Switzerland
When using PHP-FPM, open_basedir is set per user, not per domain.
When looking at the interface (CMD_PHP_SAFE_MODE), the on/off flags will mostly be wrong and any change to a domain will trigger a change in php-fpm.conf.

I understand that the system wants to keep a per domain setting, in case the admin decides to go back to mod_php, but the interface needs to be fixed.

Suggestions:
  • grey out all but the default domain per user which will act as a controller or
  • set all domains as ON or OFF and any change to a domain belonging to the user will trigger the change in all domains. This would be purely a GUI trick as DA will only change the value for the default domain
When a user changes his default domain, DA will need to make sure that setting does not change.
 
and.. interface done.
Uploading to pre-release section in a few minutes.

It will remove the check-boxes for non-default domains.. and a hover-over title will explain what's up.
The OBD setting for non-default domains will now be an href, which can be clicked to filter by the user, so the default domain show up clearly.
Changing the value for the default domain will set all domain config files for the ODB setting (to lower confusion).

John
 
and.. interface done.
Uploading to pre-release section in a few minutes.

It will remove the check-boxes for non-default domains.. and a hover-over title will explain what's up.
The OBD setting for non-default domains will now be an href, which can be clicked to filter by the user, so the default domain show up clearly.
Changing the value for the default domain will set all domain config files for the ODB setting (to lower confusion).

John
It's not working for me. Interface looks the same. What is DA looking for, in which config file in order to turn this on?
Code:
 # ./directadmin o
Compiled on 'FreeBSD 9.1 64-bit'
Compile time: Sep  7 2014 at 19:57:40
Compiled with IPv6
 
I did, but there is no installation or configuration steps.
Config: Apache + PHP-FPM1 + PHP-FPM2

All check boxes in the interface can still be used.
 
Needs to have a cache rewrite.. which *should* happen on it's own during the update via scripts/update.sh. Try:
Code:
cd /usr/local/directadmin
echo "action=cache&value=safemode" >> data/task.queue
./dataskq d2000
and the only major difference that DA should have added would be a line such as:
Code:
domain.com=[B]defaultdomain=no&[/B]open_basedir=ON&php=ON&safemode=OFF&username=username
to determine if it's a default domain or not.
The "no" would be the ones that have no checkboxes.
The cache file is at:
Code:
/usr/local/directadmin/data/admin/php_safe_mode.cache
John
 
Ah, apologies, I underestimated the power of update.sh and didn't run it, because no changes were made to it :eek:.

So now that it's working, I see a small problem. I have a main domain set to OFF, but the other domains belonging to the same user are set to ON.

Note: I like the filter by user switch. Very useful.
EDIT: Small problem with the tooltip. It shows for the whole row, but only works when clicking on the Open Basedir field. Would be great if could be made to only work on that field.
 
Last edited:
Once you save the main domain, the others will sync up.... but that's confusing.
I've set the action=syscheck to go through and sync all open_basedir values upon update.
The action=syscheck will need to add another task.queue entry for the next run (if php-fpm) because the task.queue is sorted to remove duplicates, so the update.sh's called of action=cache&value=safemode is run before the syscheck.

I've also changed the wording from "Click this Open BaseDir value" to "Click the Open BaseDir value"... should be enough I think.
Plus making a click of the <tr> to filter by the User, when the User column already has a link.. may get confusing.. 1 pixel off an it does something else.

Uploaded to the pre-release section.
Don't forget to run the scripts/update.sh, and the dataskq needs 2 runs, so might be up to 2 minutes (or just run it manually twice after the update.sh)

John
 
Once you save the main domain, the others will sync up.... but that's confusing.
I've set the action=syscheck to go through and sync all open_basedir values upon update.
The action=syscheck will need to add another task.queue entry for the next run (if php-fpm) because the task.queue is sorted to remove duplicates, so the update.sh's called of action=cache&value=safemode is run before the syscheck.

I've also changed the wording from "Click this Open BaseDir value" to "Click the Open BaseDir value"... should be enough I think.
Plus making a click of the <tr> to filter by the User, when the User column already has a link.. may get confusing.. 1 pixel off an it does something else.

Uploaded to the pre-release section.
Don't forget to run the scripts/update.sh, and the dataskq needs 2 runs, so might be up to 2 minutes (or just run it manually twice after the update.sh)

John
OK, it worked.

Regarding the tooltip, I think the title should go on the td, not the tr. Another title could be added to the "User" td to indicate that clicking on the user link will show the details for that user.

While we're there, the page should be renamed as well, "PHP Safe mode" does not exist any more and all references to it should be removed, including the main setting at the top defining the default setting for all domains. The column is already gone.
 
I've left the TR title, but added a TD title, which will override the TR for that one cell, eg:
"Clicking this will show information about this User"

And I've renamed the Admin main page to show:
Php Configuration

(not yet uploaded)

John
 
Back
Top