Page 1 of 1

Apache/PHP: Falsche VHOST-Konfiguration

Posted: 2007-10-17 11:10
by Anonymous
Hallo,

ich habe hier ein etwas seltsames Problem.

Ich benutze einen Rootserver von STRATO (Suse Linux, Apache 2.0.53, PHP 4.3.10). PHP ist als Apachemodul eingebunden.
In der httpd.conf sind u.a. 2 Websites als VHOST eingetragen (Domains seien hier a.com und b.com, Konfiguration folgt unten.

Domain a.com hat OpenBaseDir deaktiviert, b.com hat es aktiviert.
Nun bekommt man beim Aufrufen eines PHP-Scripts auf Domain a.com sporadisch eine PHP-Fehlermeldung:

"Warning: Unknown(): open_basedir restriction in effect.
File(/home/a/a.com/public_html/test.php) is not within the allowed path(s):
(/home/b/b.com/public_html:/usr/local/lib/php:/tmp) in Unknown on line 0"

Apache scheint bei diesem Aufruf also die VHOST-Konfiguration der anderen Domain zu benutzen. Wie gesagt, der Fehler tritt nur gelegentlich auf, unabhängig davon, welches Script aufgerufen wird.

Kennt jemand dieses Problem?


VHOST-Konfiguration:
--------------------

<VirtualHost *:80>
php_admin_flag engine on
php_admin_value safe_mode off
DocumentRoot /home/a/a.com/public_html/
ServerName http://www.a.com
IndexOptions
DirectoryIndex index.htm index.html index.shtml start.htm start.html start.shtml index.php index.php3
ServerAlias a.com
</VirtualHost>

<VirtualHost *:80>
php_admin_flag engine on
ServerName http://www.b.com
php_admin_value open_basedir /home/b/b.com/public_html:/usr/local/lib/php:/tmp
DocumentRoot /home/b/b.com/public_html/
IndexOptions
DirectoryIndex index.htm index.html index.shtml start.htm start.html start.shtml index.php index.php3
ServerAlias b.com
</VirtualHost>

Re: Apache/PHP: Falsche VHOST-Konfiguration

Posted: 2007-10-22 08:27
by Anonymous
Es scheint nun zu gehen, falls jemand die gleiche Problematik hat:

Bei dem einen VHOST wurde die PHP-Variable OpenBasedir nicht angegeben. Scheinbar kam der Apache dadurch durcheinander.