Disable Open_basedir in Plesk

This page explain the disabling of Open_basedir (disable open_basedir) for any domain. Sometime we need to run our test site before go live through symlinks by server ip address like http://server-ip-address/test-site.com.

When open_basedir enabled for the domain then the above steps will show an 500 error so either there is a need to add one more location in open_basedir or disable completely for that domain.

Disable open_basedir using command line

Plesk panel customize their apache/nginx configuration files so we cannot change configuration files directly as they will overwrite when reconfigure apache or restart it will automatically delete that configuration.When you open http configuration for any domain you will see commented lines at the top.

#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
#IF YOU REQUIRE TO APPLY CUSTOM MODIFICATIONS, PERFORM THEM IN THE FOLLOWING FILES:
#/var/www/vhosts/system/linuxtweaks.in/conf/vhost.conf

So first open file using your best editor

linuxtweaks ~]#vi /var/www/vhosts/linuxtweaks.in/conf/vhost.conf

add below line of code in this file

<Directory /var/www/vhosts/linuxtweaks.in/httpdocs>
php_admin_value open_basedir none
</Directory>

After completion of the above configuration you need to reconfigure apache and restart.

linuxtweaks ~]%/usr/local/psa/admin/sbin/websrvmng -v -a

open_basedir for your domain should be disabled by now.

Disable Open_basedir using Plesk Panel.

If you don’t have ssh or don’t want to use command line there no need to bother you can update it by plesk panel.

Open “Web Server Settings” under Domain configuration panel.

There is a option “Additional Apache directives”

Here you can add your code for http/https as well.

so copy same line of code in http box.

<Directory /var/www/vhosts/linuxtweaks.in/httpdocs>
php_admin_value open_basedir none
</Directory>

Click Ok . This will automatically write this line of code in “/var/www/vhosts/linuxtweaks.in/conf/vhost.conf” file and reconfigure apache and restart.

To know more about open_basedir please click here

Congrats all done !!!

Balvinder Singh

Hello, I am Balvinder Singh - DevOps Engineer with 2.5+ year of working experience with different server environments. Tag Line:-Linux | AWS| WHM |Monitoring | Virtualization | Optimization | Performance | Security | Release & Deployment. I love helping companies / clients to deploy their code / applicateions to well managed, optimized, secure server and can go extra mile to satisfy.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *