• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Issue Urgent :( open_basedir problem

Erwan

Regular Pleskian
Server operating system version
AlmaLinux 9.4
Plesk version and microupdate number
18.0.65
Hi all,
We have a problem after migrate two websites : a website with the management platform, a website with the data.
We have resumed the previous configuration but have a problem with PHP and open_basedir restriction.

The 1st website directory (management) is: /var/www/vhosts/mydomain.com/httpdocs/
The 2nd website directory (data) is: /var/www/vhosts/mydomain2.com/httpdocs/

We have defined PHP open_basedir in the plesk PHP config from the domain 1:
{WEBSPACEROOT}{/}{:}{TMP}{/}{:}/var/www/vhosts/mydomain2.com/httpdocs{:}/var/www/vhosts/mydomain2.com/httpdocs/{:}/var/www/vhosts/mydomain2.com/httpdocs//

But nothing works...

When we try to display a picture on the website 1, we have non picture and this message in the logs:
mod_fcgid: stderr: PHP Warning: is_file(): open_basedir restriction in effect. File(/var/www/vhosts/mydomain2.com/httpdocs//) is not within the allowed path(s): (/var/www/vhosts/mydomain1.com/:/tmp/:/var/www/vhosts/mydomain2.com/httpdocs:/var/www/vhosts/mydomain2.com/httpdocs/:/var/www/vhosts/mydomain2.com/httpdocs//)...

I must be missing something very simple but I don't see... help!

Erwan
 
While open_basedir is set correctly, you might be running into Linux filesystem restrictions.

Plesk folder structure and permissions prevent PHP access between subscriptions/webspaces (/var/www/vhosts/(subscription/webspace name)).

You can do a chmod 711 on /var/www/vhosts/domain2 and on /var/www/vhosts/domain2/httpdocs. However, these permission changes get flagged and reverted by plesk repair fs (with -y option passed to plesk repair you won't notice the permission revert)

If possible, I would move domain2 in the domain1 subscription/webspace. They will share the same system user and see each others files, but I suspect that is not a problem.
 
Thank you Raul.
This is what I realized even if it poses other problems for me. But I haven't found any other solutions.
 
Hey,

What about doing a symlink or Mount?
I have a similar case, will have a Look on the Server later and Post it
 
Symlinks will work only if "Restrict the ability to follow symbolic links" is disabled.

Mounts will also work but you need to make sure mounts are recreated after reboots via /etc/fstab or even autofs.

However, the simplest and most portable way is to have both websites in the same subscription/webspace.
 
Hi,

we have also few sites which have to be in separate subscriptions.

After Boot we have a Script mounting them:

mount --bind /var/www/vhosts/domain-with-content.net/httpdocs/docs /var/www/vhosts/2nd-subscription.com/httpdocs/docs
 
Back
Top