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

apache2 mit php5 auf OS 11.1 64Bit

centauro

Member
Tach Forum,

mein OpenSuse 11.1 64Bit mit Apache2 und PHP5 funktioniert nicht richtig.
Mir wird immer eine leere Seite mit meiner Hintergrundfarbe angezeigt. Woran kann das liegen?

Der Apache2-Server und der Mysql-Server lassen sich normal hochfahren:

STRUPP:/ # /etc/init.d/mysql start
Starting service MySQL done
STRUPP:/ #


STRUPP:/ # /etc/init.d/mysql start
Starting service MySQL done
STRUPP:/ #


Wenn Ihr noch mehr Infos braucht, dann lasst es mich bitte wissen.

Besten Dank und viele Grüße,

Centauro
 
OP
C

centauro

Member
Hi!

Das ist meine "httpd.conf". Hoffe, Du findest den Fehler.

Code:
#
# /etc/apache2/httpd.conf 
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs-2.2/> for detailed information about
# the directives.

# Based upon the default apache configuration file that ships with apache,
# which is based upon the NCSA server configuration files originally by Rob
# McCool. This file was knocked together by Peter Poeml <poeml+apache@suse.de>.

# If possible, avoid changes to this file. It does mainly contain Include
# statements and global settings that can/should be overridden in the
# configuration of your virtual hosts.

# Quickstart guide:
# http://www.opensuse.org/Apache_Howto_Quickstart


# Overview of include files, chronologically:
#
# httpd.conf
#  | 
#  |-- uid.conf  . . . . . . . . . . . . . .  UserID/GroupID to run under
#  |-- server-tuning.conf  . . . . . . . . .  sizing of the server (how many processes to start, ...)
#  |-- sysconfig.d/loadmodule.conf . . . . .  [*] load these modules
#  |-- listen.conf . . . . . . . . . . . . .  IP adresses / ports to listen on
#  |-- mod_log_config.conf . . . . . . . . .  define logging formats
#  |-- sysconfig.d/global.conf . . . . . . .  [*] server-wide general settings
#  |-- mod_status.conf . . . . . . . . . . .  restrict access to mod_status (server monitoring)
#  |-- mod_info.conf . . . . . . . . . . . .  restrict access to mod_info
#  |-- mod_usertrack.conf  . . . . . . . . .  defaults for cookie-based user tracking
#  |-- mod_autoindex-defaults.conf . . . . .  defaults for displaying of server-generated directory listings
#  |-- mod_mime-defaults.conf  . . . . . . .  defaults for mod_mime configuration
#  |-- errors.conf . . . . . . . . . . . . .  customize error responses
#  |-- ssl-global.conf . . . . . . . . . . .  SSL conf that applies to default server _and all_ virtual hosts
#  |
#  |-- default-server.conf . . . . . . . . .  set up the default server that replies to non-virtual-host requests
#  |    |--mod_userdir.conf  . . . . . . . .  enable UserDir (if mod_userdir is loaded)
#  |    `--conf.d/apache2-manual?conf  . . .  add the docs ('?' = if installed)
#  |
#  |-- sysconfig.d/include.conf  . . . . . .  [*] your include files 
#  |                                             (for each file to be included here, put its name 
#  |                                              into APACHE_INCLUDE_* in /etc/sysconfig/apache2)
#  |
#  `-- vhosts.d/ . . . . . . . . . . . . . .  for each virtual host, place one file here
#       `-- *.conf . . . . . . . . . . . . .     (*.conf is automatically included)
#
#
# Files marked [*] are created from sysconfig upon server restart: instead of
# these files, you edit /etc/sysconfig/apache2



#  Filesystem layout:
#
# /etc/apache2/
#  |-- charset.conv  . . . . . . . . . . . .  for mod_auth_ldap
#  |-- conf.d/
#  |   |-- apache2-manual.conf . . . . . . .  conf that comes with apache2-doc
#  |   |-- mod_php4.conf . . . . . . . . . .  (example) conf that comes with apache2-mod_php4
#  |   `-- ... . . . . . . . . . . . . . . .  other configuration added by packages
#  |-- default-server.conf
#  |-- errors.conf
#  |-- httpd.conf  . . . . . . . . . . . . .  top level configuration file
#  |-- listen.conf
#  |-- magic
#  |-- mime.types -> ../mime.types
#  |-- mod_autoindex-defaults.conf
#  |-- mod_info.conf
#  |-- mod_log_config.conf
#  |-- mod_mime-defaults.conf
#  |-- mod_perl-startup.pl
#  |-- mod_status.conf
#  |-- mod_userdir.conf
#  |-- mod_usertrack.conf
#  |-- server-tuning.conf
#  |-- ssl-global.conf
#  |-- ssl.crl/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificate Revocation Lists (CRL)
#  |-- ssl.crt/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificates
#  |-- ssl.csr/  . . . . . . . . . . . . . .  PEM-encoded X.509 Certificate Signing Requests
#  |-- ssl.key/  . . . . . . . . . . . . . .  PEM-encoded RSA Private Keys
#  |-- ssl.prm/  . . . . . . . . . . . . . .  public DSA Parameter Files
#  |-- sysconfig.d/  . . . . . . . . . . . .  files that are created from /etc/sysconfig/apache2
#  |   |-- global.conf
#  |   |-- include.conf
#  |   `-- loadmodule.conf
#  |-- uid.conf
#  `-- vhosts.d/ . . . . . . . . . . . . . .  put your virtual host configuration (*.conf) here
#      |-- vhost-ssl.template
#      `-- vhost.template



### Global Environment ######################################################
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests.

# run under this user/group id
Include /etc/apache2/uid.conf

# - how many server processes to start (server pool regulation)
# - usage of KeepAlive
Include /etc/apache2/server-tuning.conf

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
ErrorLog /var/log/apache2/error_log

# generated from APACHE_MODULES in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/loadmodule.conf

# IP addresses / ports to listen on
Include /etc/apache2/listen.conf

# predefined logging formats
Include /etc/apache2/mod_log_config.conf

# generated from global settings in /etc/sysconfig/apache2
Include /etc/apache2/sysconfig.d/global.conf

# optional mod_status, mod_info
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf

# optional cookie-based user tracking
# read the documentation before using it!!
Include /etc/apache2/mod_usertrack.conf

# configuration of server-generated directory listings
Include /etc/apache2/mod_autoindex-defaults.conf

# associate MIME types with filename extensions
TypesConfig /etc/apache2/mime.types
DefaultType text/plain
Include /etc/apache2/mod_mime-defaults.conf

# set up (customizable) error responses
Include /etc/apache2/errors.conf

# global (server-wide) SSL configuration, that is not specific to 
# any virtual host
Include /etc/apache2/ssl-global.conf

# forbid access to the entire filesystem by default
<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

# use .htaccess files for overriding,
AccessFileName .htaccess
# and never show them
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

# List of resources to look for when the client requests a directory
DirectoryIndex index.html index.html.var

### 'Main' server configuration #############################################
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
Include /etc/apache2/default-server.conf


# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS
Include /etc/apache2/sysconfig.d/include.conf


### Virtual server configuration ############################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
Include /etc/apache2/vhosts.d/*.conf


# Note: instead of adding your own configuration here, consider 
#       adding it in your own file (/etc/apache2/httpd.conf.local)
#       putting its name into APACHE_CONF_INCLUDE_FILES in 
#       /etc/sysconfig/apache2 -- this will make system updates 
#       easier :)
 

Dr. Glastonbury

Advanced Hacker
Moin,
benutze doch bitte in Zukunft die
Code:
-Tags! Ich hab das jetzt mal für dich gemacht -> wird das ganze wesentlich übersichtlicher ;)
 

panamajo

Guru
Die httpd.conf ist bei openSUSE wenig aussagekräftig da sie nur includes zu den jwlg. Modulen enthält.

Was steht in den Los dea Apache (/var/log/apache2/*log)?
 
OP
C

centauro

Member
Hi!

Folgendes steht in der error_log des Webservers:

Code:
[Sat Jan 31 02:16:15 2009] [error] [client 127.0.0.1] PHP Warning:  session_start(): open(/srv/www/tmp/sess_3m9g9kr1lsd2pec1q0iu2967bq6auc8h, O_RDWR) failed: Permission denied (13) in /srv/www/htdocs/KGS/frames/index.php on line 2
[Sat Jan 31 02:16:15 2009] [error] [client 127.0.0.1] PHP Fatal error:  Call to undefined function logged_in() in /srv/www/htdocs/KGS/frames/index.php on line 14
[Sat Jan 31 02:16:15 2009] [error] [client 127.0.0.1] PHP Warning:  Unknown: open(/srv/www/tmp/sess_3m9g9kr1lsd2pec1q0iu2967bq6auc8h, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[Sat Jan 31 02:16:15 2009] [error] [client 127.0.0.1] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/srv/www/tmp) in Unknown on line 0
[Sat Jan 31 02:16:15 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 02:16:15 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 02:16:15 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 02:16:15 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 02:16:15 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 02:16:15 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 02:16:15 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 02:16:15 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'

Bei manchen Dateizugriffen kommt ein "permission denied", obwohl ich schreib/lese Rechte für alle gewährt hab.
Warum das so ist, müsst Ihr mir verraten.
 

Dr. Glastonbury

Advanced Hacker
Huhu ;)
existiert der Ordner /srv/www/tmp/ und hat der user wwwrun bzw. die gruppe www lese und schreibrechte in diesem Ordner (sonstige brauchen den Ordner weder lesen noch schreiben können)?
Ansonsten diesen Ordner anlegen und via chown wwwrun:www /srv/www/tmp dem Benutzer und Gruppe zuordnen, sowie über chmod 750 /srv/www/tmp die entsprechenden Berechtigungen vergeben...
 
OP
C

centauro

Member
Hi!

Vielen Dank für Dein posting. Ich habe Deinen Rat befolgt. Aber egal was ich tue, es kommen immer wieder die selben oder ähnliche Fehlermeldungen.

Ich habe nun das Verzeichnis meiner Anwendung gelöscht und habe es mir nun wieder von meinem Windowsverzeichnis rüber zum Suse Verzeichnis /srv/www/htdocs kopiert.

Anschliessend habe ich meinen Benutzer als Eigentümer auf alle Dateien und Verzeichnisse gesetzt und lese/schreib/ und ausführungsberechtigungen vergeben. Dann habe ich die Gruppe "users" und die Gruppe "sonstige" mit den selben Berechtigungen versehen.

Ich wollte mal prüfen was passiert, wenn ich allen alle Berechtigungen gebe. Aber ich kann trotzdem nicht einmal die Hauptseite meiner Anwendung leider nicht öffnen.
 

Dr. Glastonbury

Advanced Hacker
Hmmmm,
hast du etwas, wie suPHP installiert? Und ansonsten gib doch auch dem Ordner htdocs mal die Gruppe www und den User wwwrun (sofern du das noch nicht probiert hast, geht jetzt oben irgendwie nich so hervor ;) )
chown -R wwwrun:www /srv/www/htdocs <- durch das -R wird der Vorgang rekursiv für alle Unterordner vorgenommen (vielleicht liegt auch hier dein Problem, dass du die Berechtigungen nicht für die Unterordner vorgenommen hast...)

Und steht in den Fehlermeldungen wirklich nach wie vor, dass er die Session nicht speichern kann? Oder beschränkt es sich auf Fehler alla "Call to undefined function logged_in()"?
 
OP
C

centauro

Member
Hi!

Hatte ich zuvor auch schon probiert und habe es jetzt nochmal gesetzt, wie auch für das tmp Verzeichnis.

Was die Fehlermeldungen betrifft, kommen beide Meldungen. Sowohl die Meldung, dass die Session nicht geschrieben oder gelesen werden kann, weil die Datei index.php nicht darauf zugreiffen kann (weil die session nicht da ist) als auch die Meldung, dass die function nicht definiert ist.

Info: Unter windows Vista läuft alles prima ohne Fehlermeldungen.

Hier nochmal die Meldung:

Code:
[Sat Jan 31 14:46:29 2009] [error] [client ::1] PHP Warning:  session_start(): open(/srv/www/tmp/sess_d9j0lp7qjiun5gdng8vog12ll5ocq5c1, O_RDWR) failed: Permission denied (13) in /srv/www/htdocs/KGS/frames/index.php on line 2
[Sat Jan 31 14:46:29 2009] [error] [client ::1] PHP Fatal error:  Call to undefined function logged_in() in /srv/www/htdocs/KGS/frames/index.php on line 14
[Sat Jan 31 14:46:29 2009] [error] [client ::1] PHP Warning:  Unknown: open(/srv/www/tmp/sess_d9j0lp7qjiun5gdng8vog12ll5ocq5c1, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[Sat Jan 31 14:46:29 2009] [error] [client ::1] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/srv/www/tmp) in Unknown on line 0

Hast Du noch ne Idee? :-(((
 

panamajo

Guru
Und den Inhalt der Datei
/etc/apache2/uid.conf

Ist da auch der openSUSE Apache2 + PHP5 installiert oder ist das XAMPP o.ä.? Bei openSUSE werden die Sessions eigentlich in /var/lib/php5 abgelegt...
 
OP
C

centauro

Member
@spoensche:

da steht nichts drin.

@panamajoe:

in der uid.conf steht lediglich der User und die Gruppe drin.

xampp oder wie es für linux heißt "lampp" kann auf nem 64Bit System leider nicht installiert werden.
Alles schon probiert. :)

Der save-Pfad der Sessions war ursprünglich auf /var/lib/php5 gesetzt. Ich hatte ihn anschliessend geändert, was auch mal funktionierte.
Inzwischen geht garnichts mehr. Im /var/lib/php5 Verzeichnis werden die Sessions leider auch nicht gespeichert.
In der error_log wird auch der richtige Pfad angezeigt. Das sagt mir, dass die richtige php.ini Datei ausgelesen wird. -->ist doch schonmal was. :)

Dennoch fehlen die Schreib-/leseberechtigungen der Dateien, die mit session_start() die abgelegten Sessions auslesen müssen, obwohl sowohl die Berechtigungen für die Verzeichnisse als auch die der user gesetzt sind.

Irgendwas läuft noch falsch.

Hier nochmal die error_log ausgabe:

Code:
[Sat Jan 31 15:44:48 2009] [error] [client ::1] PHP Warning:  session_start(): open(/var/lib/php5/sess_d9j0lp7qjiun5gdng8vog12ll5ocq5c1, O_RDWR) failed: Permission denied (13) in /srv/www/htdocs/KGS/frames/index.php on line 2
[Sat Jan 31 15:44:48 2009] [error] [client ::1] PHP Fatal error:  Call to undefined function logged_in() in /srv/www/htdocs/KGS/frames/index.php on line 14
[Sat Jan 31 15:44:48 2009] [error] [client ::1] PHP Warning:  Unknown: open(/var/lib/php5/sess_d9j0lp7qjiun5gdng8vog12ll5ocq5c1, O_RDWR) failed: Permission denied (13) in Unknown on line 0
[Sat Jan 31 15:44:48 2009] [error] [client ::1] PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php5) in Unknown on line 0
[Sat Jan 31 15:44:48 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 15:44:48 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 15:44:49 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 15:44:49 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 15:44:49 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 15:44:49 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 15:44:49 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'
[Sat Jan 31 15:44:49 2009] [error] Failed to change_hat to 'HANDLING_UNTRUSTED_INPUT'

Im Verzeichnis steht trotz Löschen der cookies und Aktualisierung des Browserinhalts nichts drin.
Die Rechte sind auch für dieses Verzeichnis so gesetzt, sodass root die volle Berechtigung hat. Dennoch wird nichts reingeschrieben.

Bin total verwirrt und frustriert. Dachte immer, ich kenne mich mit diesem Kram aus. So kann man sich irren.
 

panamajo

Guru
Du machst grundsätzlich nicht was man dir sagt, oder?
centauro schrieb:
da steht nichts drin.
Das war zu erwarten, es geht aber um die Berechtigungen.

centauro schrieb:
in der uid.conf steht lediglich der User und die Gruppe drin.
Natürlich, dazu ist die Datei ja auch da. Aber welcher User und welche Gruppe?

centauro schrieb:
xampp oder wie es für linux heißt "lampp" kann auf nem 64Bit System leider nicht installiert werden.
3 falsche Aussagen in einem Satz:
XAMPP heisst immer XAMPP, das X ist die Metavariable.
XAMPP kann sehr wohl auf einem 64bit System installiert werden, läuft dann aber im 32bit Modus
"Leider" ist auch falsch, denn die openSUSE Pakete sind besser geeignet.

centauro schrieb:
Der save-Pfad der Sessions war ursprünglich auf /var/lib/php5 gesetzt. Ich hatte ihn anschliessend geändert
Warum? Um die Zahl der möglichen Fehlerquellen zu erhöhen?

centauro schrieb:
Die Rechte sind auch für dieses Verzeichnis so gesetzt, sodass root die volle Berechtigung hat. Dennoch wird nichts reingeschrieben.
Nur laufen die PHP Prozesse nicht als root sondern (falls nicht geändert) als wwwrun:www und dieser User benötigt Schreibrechte für das tmp Verzeichnis
 
OP
C

centauro

Member
Entschuldigt bitte. Das war der Frust in mir.

Also hier die Antworten:

Inhalt des Verzeichnisses "/var/lib/php5"

Code:
Name                               Größe        Dateityp        Berechtigungen        Eigentümer    Gruppe
session_mm_apache2handler0.sem     0 B      Leeres Dokument    -rw-------              wwwrun        www

Berechtigungen des Verzeichnisses "/etc/apache2/uid.conf"

Code:
Name        Größe         Dateityp              Berechtigungen        Eigentümer         Gruppe
uid.conf       22 B     Einfacher Text           -rw-------             wwwrun             www

[b]Inhalt des Verzeichnisses "/etc/apache2/uid.conf"[/b]
User wwwrun
Group www

Ich hoffe, ich habe nichts vergessen.
 
OP
C

centauro

Member
Aber ich habe doch den Verzeichnispfad wieder umgestellt gehabt auf /var/lib/php5, wie man weiter oben im error_log sehen kann.

Code:
/srv/www # ls -alF tmp/
insgesamt 8
drwxr-x---+ 2 wwwrun www  4096 31. Jan 12:54 ./
drwxrwxr-x  7 root   root 4096 26. Jan 00:53 ../

Ich stelle es nun wieder in der php.ini um auf /srv/www/tmp

Habe den Webserver restartet.

Error_log:

Code:
[Sat Jan 31 17:41:26 2009] [error] [client ::1] PHP Warning:  session_start(): open(/srv/www/tmp/sess_d9j0lp7qjiun5gdng8vog12ll5ocq5c1, O_RDWR) failed: Permission denied (13) in /srv/www/htdocs/KGS/frames/index.php on line 2
[/code]
 
OP
C

centauro

Member
Hi!

Bis hierher erstmal vielen Dank.
Ich muß für heute leider abbrechen und morgen weiter machen.

Wünsche Euch noch einen schönen Abend.
Bin morgen wieder hier.

Vielleicht bis morgen und besten Dank nochmal.

lg,

centauro
 
Oben