• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Verzeichnis für php-Dateien

mampfi

Hacker
Meine httpd.conf verweise auf eine default-server.conf

In dieser hab ich das DocumentRoot verändert, weil ich meine php-Programme gerne in einem anderen Verzeichnis haben möchte.

Funzt leider nicht.

Was mache ich falsch?
 

gameboy

Hacker
Hallo mampfi,

kannst Du Dein Problem etwas präziser beschreiben, z.B.
- die DocumentRoot-Definition aus httpd.conf
- alle Directory-Blöcke aus httpd.conf
- Rechte auf dem als Doc-Root verwendeten Verzeichnis
- konkrete Fehlermeldung, die beim Aufruf einer PHP-Seite im Browser angezeigt wird
- Log-Einträge aus /var/log/apache2/error_log
- etc.?

Ohne weitere Infos würde ich darauf tippen, daß entweder für Dein Document-Root auf Filesystem-Ebene nicht die richtigen Rechte gesetzt sind oder daß Du für Dein Document-Root keinen entsprechenden <Directory>-Block (mit Allow from all) in der httpd.conf eingetragen hast.
 
OP
M

mampfi

Hacker
Die httpd.conf verweist auf auf die default-server.conf

Unten abgebildet ist der relevante Abschnitt der default-conf, wie ich sie vorgefunden habe.


DocumentRoot "/srv/www/htdocs" habe ich durch
DocumentRoot "/daten/prog/php" ersetzt.

Als darin befindliche php-Dateien nicht ausgeführt wurden, hab ich das Verzeichnis auch in dem Abschnitt Configure the DocumentRoot geändert.

In beiden Fällen habe ich brav /etc/init.d/apache2 restart ausgeführt.

Besitzer des Verzeichnisses /srv ist root. Alle Benutzer haben sämtliche Zugriffsrechte.
------------------------------------------------------
DocumentRoot "/srv/www/htdocs"

#
# Configure the DocumentRoot
#
<Directory "/srv/www/htdocs">
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs-2.0/mod/core.html#options
# for more information.
Options None
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
AllowOverride None
# Controls who can get stuff from this server.
Order allow,deny
Allow from all
</Directory>
 

gameboy

Hacker
mampfi schrieb:
DocumentRoot "/srv/www/htdocs" habe ich durch
DocumentRoot "/daten/prog/php" ersetzt.
Dann solltest Du meines Erachtens auch
Code:
<Directory "/srv/www/htdocs">
durch
Code:
<Directory "/daten/prog/php">
ersetzen, denn innerhalb des Directory-Blocks steht ja das "Allow from all", welches den Zugriff auf dieses Verzeichnis gestattet.

Nach der Änderung an der httpd.conf dann natürlich wieder mit
Code:
/etc/init.d/apache2 reload
den Apachen dazu veranlassen, seine Config neu einzulesen.

Ist das Problem damit gelöst? - Wenn nein: Was steht nach einem erfolglosen Zugriffsversuch in /var/log/apache2/error_log?
 
Oben