PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [APACHE - PHP] open_basedir restriction



MoR4euZ
29.11.04, 10:48
Hallo ich habe ein problem mit meinem webserver (apache, suse9) ich will die libfiles (php) an einem sicherem ort abspeichern und so platzieren das sie gut ereichbar sind

klappt nurnoch net so ganz :)



xyz:/srv # ls -l
total 16
drwxr-xr-x 4 root www 4096 Sep 16 13:23 .
drwxr-xr-x 20 root root 4096 Nov 19 14:37 ..
drwxr-xr-x 2 root root 4096 Oct 2 2003 ftp
drwxr-xr-x 9 root www 4096 Nov 22 11:30 www

xyz:/srv/www # ls -l
total 36
drwxr-xr-x 9 root www 4096 Nov 22 11:30 .
drwxr-xr-x 4 root www 4096 Sep 16 13:23 ..
drwxr-xr-x 2 root root 4096 Aug 26 05:20 cgi-bin
drwxr-xr-x 2 root root 4096 Nov 10 2003 fcgi-bin
drwxr-xr-x 4 root root 4096 Aug 26 05:20 htdig
drwxr-xr-x 8 root www 4096 Nov 29 11:10 htdocs
drwxr-xr-x 2 root root 4096 Aug 26 05:38 icons
drwxr-xr-x 4 root www 4096 Nov 22 22:58 lib
drwxr-xr-x 2 root root 4096 Nov 10 2003 perl-lib

xyz:/srv/www/htdocs # ls -l
total 32
drwxr-xr-x 8 root www 4096 Nov 29 11:10 .
drwxr-xr-x 9 root www 4096 Nov 22 11:30 ..
drwxr-xr-x 5 wwwrun www 4096 Aug 26 03:55 confixx
dr--r--r-- 2 root root 4096 Oct 30 2003 empty
drwxr-xr-x 7 root root 4096 Oct 30 2003 phpMyAdmin
dr-xr-x--- 7 web1 www 4096 Aug 28 15:58 web1
drwxr-xr-x 2 root root 4096 Oct 29 2003 webalizer

ich möchte das web1 (srv/www/htdocs/web1) die php-scripts aus /srv/www/lib benutzten kann

welche rechte sind wo erfoderlich ?

libfiles unter web1
kommt folgende php error meldung



Warning: main(): open_basedir restriction in effect. File(/srv/www/lib/lib/config/config_iq.php) is not within the allowed path(s): (/srv/www/htdocs/web1/:/srv/www/htdocs/phpMyAdmin/:/srv/www/htdocs/confixx/html/gesperrt/) in /srv/www/htdocs/web1/html/verwaltung/index.php on line 17

Warning: main(/srv/www/lib/lib/config/config_iq.php): failed to open stream: Operation not permitted in /srv/www/htdocs/web1/html/verwaltung/index.php on line 17

Warning: main(): Failed opening '/srv/www/lib/lib/config/config_iq.php' for inclusion (include_path='.:/usr/share/php') in /srv/www/htdocs/web1/html/verwaltung/index.php on line 17

Warning: main(): open_basedir restriction in effect. File(/srv/www/lib/lib/lib.php) is not within the allowed path(s): (/srv/www/htdocs/web1/:/srv/www/htdocs/phpMyAdmin/:/srv/www/htdocs/confixx/html/gesperrt/) in /srv/www/htdocs/web1/html/verwaltung/index.php on line 18

Warning: main(/srv/www/lib/lib/lib.php): failed to open stream: Operation not permitted in /srv/www/htdocs/web1/html/verwaltung/index.php on line 18

Warning: main(): Failed opening '/srv/www/lib/lib/lib.php' for inclusion (include_path='.:/usr/share/php') in /srv/www/htdocs/web1/html/verwaltung/index.php on line 18

Fatal error: Call to undefined function: auth_login() in /srv/www/htdocs/web1/html/verwaltung/index.php on line 24

laut phpinfo hat open_basedir folgende werte

local value
/srv/www/htdocs/web1/:/srv/www/htdocs/phpMyAdmin/:/srv/www/htdocs/confixx/html/gesperrt/

master value
no value

wie kann ich den local value auf /srv/www/ legen ?
in der php.ini ist open_basedir nur auskommentiert

safe_mode ist on und muss es auch bleiben

bin dankbar für jede hilfestellung :(

Tomek
29.11.04, 11:57
Warning: main(): Failed opening '/srv/www/lib/lib/config/config_iq.php' for inclusion (include_path='.:/usr/share/php') in /srv/www/htdocs/web1/html/verwaltung/index.php on line 17

Müsste es nicht eher heissen /srv/www/lib/config/config_iq.php heissen?

Trotz der evtl. Korrektur würde dein Problem weiterhin bestehen, denn das Verzeichnis lib ist eben nicht im Verzeichnis web1. Also außerhalb des erlaubten Basedirs.

Du scheinst Confixx zu benutzen, deshalb hast du u.a. folgende Möglichkeiten das Problem zu lösen:
1) Lege das Verzeichnis lib in web1. (einfachste Lösung)
2) Man kann bei Confixx sogenannte HTTPD-Spezialeinträge für Domains/Kunden erstellen. Dieser könnte dann sein:

php_admin_value open_basedir /srv/www/lib/:/srv/www/htdocs/web1/:/srv/www/htdocs/phpMyAdmin/:/srv/www/htdocs/confixx/html/gesperrt/

MoR4euZ
29.11.04, 17:11
danke für deine antwort

das lib/lib stimmt schon fürs erste ;)

es wäre schon ganz schön wen ich die verzeichnissstrucktur wie geplannt verwenden könnte


wo soll ich den das



php_admin_value open_basedir /srv/www/lib/:/srv/www/htdocs/web1/:/srv/www/htdocs/phpMyAdmin/:/srv/www/htdocs/confixx/html/gesperrt/


eintragen ?

für domain und kunde ?

unter domain finde ich die subdomain web1.xyz.hoster.de