• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

vhost.cof being loaded but open_basedir not set

S

scarydog

Guest
Hi all,

i have just upgraded to Plesk 8 and have found a number of sites not working because of new safe mode settings.

I have been able to overcome these by changing ownership of some of the files to apache.

I am having a problem with vhost.cof being loaded but not changing the open_basedir as I have set it.

I have changed in the virtual hosts http.include and it is working but I understand that this change will be wiped.

some values in the vhost.conf are being loaded and used, for instance i was able to set safe_mode_GID

Any help would be much appreciated!

Regards
Nathan
 
Im having the same issues i need php_admin_value open_basedir but since the upgrade we cant load any of the users vhost.conf's with any php_admin_value or php_admin_flag how are we supposed to set them now?
 
You need to enclose your settings within <Directory>. The relevant parts of the httpd.include file looks like this:
Code:
<Directory /var/www/vhosts/example.com/httpdocs>
	<IfModule sapi_apache2.c>
		php_admin_flag engine on
		php_admin_flag safe_mode on
		php_admin_value open_basedir "/var/www/vhosts/example.com/httpdocs:/tmp"
	</IfModule>
	<IfModule mod_php5.c>
		php_admin_flag engine on
		php_admin_flag safe_mode on
		php_admin_value open_basedir "/var/www/vhosts/example.com/httpdocs:/tmp"
	</IfModule>
</Directory>
Include /var/www/vhosts/example.com/conf/vhost.conf
Settings within <Directory> override settings within <VirtualHost> so those settings not explicitly set by Plesk (within the <Directory> in httpd.include) can be set fine, but otherwise your vhost.conf file needs to look like this (customised to whatever you need of course!):
Code:
<Directory /var/www/vhosts/example.com/httpdocs>
	php_admin_flag safe_mode off
	php_admin_value open_basedir none
</Directory>
I hope this helps you!
 
Hi,

thanks crossconnect!

my fault was, thas I used:

Code:
<Directory /var/www/vhosts/example.com>
	php_admin_flag safe_mode off
	php_admin_value open_basedir none
</Directory>

and not:

Code:
<Directory /var/www/vhosts/example.com/httpdocs>
	php_admin_flag safe_mode off
	php_admin_value open_basedir none
</Directory>

Because of /var/www/vhosts/example.com/httpdocs was already set in httpd.include before, it cannot be overwriten with /var/www/vhosts/example.com/ (without /httpddocs)

Ciao...
 
No worries. I'm guessing that maybe the "httpdocs" bit was only added in Plesk 8.

I'm a Plesk newbie (clean install with version 8) so I haven't had to go through the upgrade process, and from the sound of it, that's a good thing :)
 
Damn, it needed the entry from a file named
httpd.include

/var/www/vhosts/<domain>/httpdocs:/tmp

/tmp is probably some mystery path Plesk needs...

I didn't know that with colons you can simply add entries.

Everything is working now :)
 
Help Me!!!

upgraded to plesk 8, have this issue now.

Openbase_dir Error:
Code:
Warning: Unknown(): open_basedir restriction in effect. File(/home/httpd/vhosts/urbansherpa.biz/httpdocs/index.php) is not within the allowed path(s): (/home/httpd/vhosts/urbansherpa.biz/httpdocs) in Unknown on line 0



This is what i have in the vhost.conf file

Code:
<Directory /home/httpd/vhosts/urbansherpa.biz/httpdocs>
php_admin_value open_basedir "/home/httpd/vhosts/urbansherpa.biz/httpdocs"
</Directory>
<IfModule mod_php4.c>
php_flag log_errors on
php_value error_log "/home/httpd/vhosts/urbansherpa.biz/statistics/logs/error_log"
</IfModule>
<Directory /home/httpd/vhosts/urbansherpa.biz/httpdocs>
php_admin_flag engine on
php_admin_value register_globals 1
php_admin_value safe_mode off
</Directory>


What am i doing wrong?

No matter what i do, in phpconfig file it still shows global value of:
/home/httpd/vhosts/urbansherpa.biz/httpdocs:/tmp


and ignores the "local value" i have in the conf file.


Please help me....
 
You have two directory tags in your vhost file. Consolidate down to one.
 
Back
Top