Apache2, suPHP und mod_php

Apache, Lighttpd, nginx, Cherokee
Post Reply
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Apache2, suPHP und mod_php

Post by moppi »

Hallo,

bei dem alten Apache 1.3 ging es wunderbar, leider bei Apache2 nicht mehr. Das Gerät tut es nicht die kurriosesten Fehlermeldungen trotz korrekter installation. Hier ein Beispiel:

Code: Select all

[Fri Jul 23 14:15:17 2004] [error] [client 80.142.78.162] Premature end of script headers: index.php
[Fri Jul 23 14:15:17 2004] [error] [client 80.142.78.162] Error in log.c on line 68: Could not open logfile (Permission denied)
Gibt es noch andere Software die das Problem löst?
schl
Posts: 343
Joined: 2003-02-05 11:26
Location: München/Unterschleißheim
 

Re: Apache2, suPHP und mod_php

Post by schl »

http://www.chl-virtualwork.de/server_doku.html

dort findest Du ein Beispiel, wie man mod_php und suphp konfiguriert
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Apache2, suPHP und mod_php

Post by moppi »

Der Fehler bleibt:

Code: Select all

[Fri Jul 23 15:39:14 2004] [error] [client 80.142.78.162] Premature end of script headers: index.php
[Fri Jul 23 15:39:14 2004] [error] [client 80.142.78.162] Error in log.c on line 68: Could not open logfile (Permission denied)
ich habe suPHP installiert wie im howto aber das ergenis ist gleich...

EDIT: ich habe es jetzt in der log.c angepasst dieser fehler tritt nicht mehr auf, leider aber der Fehler Premature end of Script. Ich habe aber die PHP CGI version drauf unter /usr/bin. Der Pfad im suexec binary passt auch. Ich verstehe das nicht...

EDIT2:
hier der auszug aus der suphp_log:

Code: Select all

[Fri Jul 23 15:51:43 2004] [info] Executing /var/www/localhost/htdocs/web1/html/index.php as user web1 (647), group ftponly (501)
EDIT3:
jetzt scheint er das binary nicht zu finde, dabei ist es an der richtigen stelle auch mit den entsprechenden rechten:

Code: Select all

[Fri Jul 23 16:15:32 2004] [error] [client 80.142.78.162] (2)No such file or directory: couldn't create child process: /usr/sbin/suphp for /var/www/localhost/htdocs/web1/html/index.php

Code: Select all

rubidium src # ls -l /usr/bin/suphp
-rwsr-xr-x  1 root root 64768 Jul 23 16:13 /usr/bin/suphp
EDIT4:
ich habe jetzt sämtliche Pfade korrigiert und er frisst es einfach nicht er woll logdateien anlegen in verzeichnissen wo ich nicht möchte - kann mir nicht jemand ein fertiges binary zukommen lassen?
chinese_postman
Posts: 34
Joined: 2003-07-17 17:30
 

Re: Apache2, suPHP und mod_php

Post by chinese_postman »

Ich kann dir ein Woody Package anbieten.

Ciao,
cp
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Apache2, suPHP und mod_php

Post by moppi »

Danke für Dein Angebot ich bräuchte aber denke ich modifikationen und genau das ist das Problem. Herr Marsching schreibt mir leider bezüglich meiner Anfrage auch nicht zurück :cry:

ich habe den sourcecode entpackt und beim ./configure wirklich die benötigten optionen angegeben und er will 1. den log nicht da ablegen wo ich ihn haben will. und dann strört es sich noch an etwas aber dessen ursache ist nicht ergründet.

Wer kann mir helfen ich benötige nur das "suexec" und "mod_suphp.so" nach dem compilieren.

Das Log müsste hier liegen:

Code: Select all

/var/log/apache2/suphp_log"
als min GID und UID wäre die

Code: Select all

96
hilfreich. das suphp binary sollte sich unter

Code: Select all

/usr/sbin/suphp
wohlfühlen können.

Vielen Herzlichen Dank!
wgot
Posts: 1675
Joined: 2003-07-06 02:03
 

Re: Apache2, suPHP und mod_php

Post by wgot »

--- erledigt, schief gelesen ---
sascha
Posts: 1325
Joined: 2002-04-22 23:08
 

Re: Apache2, suPHP und mod_php

Post by sascha »

Welches OS und wie hast du suphp konfiguriert?

Unter meinem Debian Sarge läuft es so hervorragend:

Code: Select all

./configure 
        --prefix=/opt/suphp 
        --enable-checkpath 
        --enable-checkuid 
        --enable-checkgid 
        --with-apxs=/usr/bin/apxs2 
        --with-setid-mode=owner 
        --with-min-uid=100 
        --with-min-gid=100 
        --with-apache-user=www-data 
        --with-php=/usr/lib/cgi-bin/php4 
        --with-logfile=/var/log/apache2/suphp.log
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Apache2, suPHP und mod_php

Post by moppi »

also hier ist mein PHP binary

Code: Select all

rubidium tmp # ls -l /usr/bin/php
-rwxr-xr-x  1 root root 4434256 Jul 22 14:21 /usr/bin/php
und das habe ich auch immer in pfad mit angegeben.
Ich bin am verzweifeln!

EDIT:

Code: Select all

rubidium suphp-0.5.2 # ./configure --prefix=/usr/bin --enable-checkpath --enable-checkuid --enable-checkgid --with-apxs=/usr/sbin/apxs2 --with-setid-mode=owner --with-min-uid=100 --with-min-gid=100 --with-apache-user=apache --with-php=/usr/bin/php --with-logfile=/var/log/apache2/suphp.log
EDIT2:

Code: Select all

[Mon Jul 26 10:43:55 2004] [error] [client 80.142.73.86] (13)Permission denied: couldn't create child process: /usr/bin/sbin/suphp for /var/www/localhost/htdocs/web3/html/index.php, referer: http://www.hotel-teufelsmauer.de/
ummmmm....

EDIT4:
habe bemerkt das die berechtigungen für das suphp bin nicht richtig waren, aber diese quelle wurde ausgeschlossen als nächstes dann die log.c die ärger mache weil sie nicht akzeptiert welchen pfad sie aus meinem configure nehmen soll. so eine ka**e :evil:

Code: Select all

[Mon Jul 26 10:49:51 2004] [error] [client 80.142.73.86] Premature end of script headers: index.php, referer: http://www.hotel-teufelsmauer.de/
[Mon Jul 26 10:49:51 2004] [error] [client 80.142.73.86] Error in log.c on line 68: Could not open logfile (Permission denied), referer: http://www.hotel-teufelsmauer.de/
sascha
Posts: 1325
Joined: 2002-04-22 23:08
 

Re: Apache2, suPHP und mod_php

Post by sascha »

Hast du die Quellen mal frisch ausgepackt? Pfuschen am Sourcecode ist bei suPHP ja normalerweise nicht notwendig. Wie sehen die Rechte bzgl. /var/log/apache2 aus? Ach ja, dein --prefix ist etwas merkwürdig.
moppi
Posts: 368
Joined: 2003-02-15 11:16
 

Re: Apache2, suPHP und mod_php

Post by moppi »

Hallo Sascha,

hier die Info:

Code: Select all

rubidium suphp-0.5.2 # ls -l /var/log/apache2
total 34340
-rw-r--r--  1 root root   990161 Jul 26 11:16 access_log
-rw-r--r--  1 root root  2155077 Jul 26  2004 confixxlogin.de_access.log
-rw-r--r--  1 root root 30738777 Jul 26 11:16 confixxlogin.de_error.log
drwxr-xr-x  4 root root     4096 Jul 22 17:16 domains
-rw-r--r--  1 root root   280136 Jul 26 11:16 error_log
drwxr-xr-x  4 root root     4096 Jul 22 17:16 kunden
drwx------  4 root root     4096 Jul 22 17:16 old
-rw-r--r--  1 root root   385261 Jul 26  2004 ssl_access_log
-rw-r--r--  1 root root    80596 Jul 23 14:32 ssl_error_log
-rw-r--r--  1 root root   432702 Jul 26  2004 ssl_request_log
-rw-r--r--  1 root root     3731 Jul 26  2004 stdlog_access
-rw-r--r--  1 root root     1644 Jul 23 12:52 suexec_log
-rw-------  1 root root      650 Jul 23 16:06 suphp_log
Ich entpacke suphp bei jedem versuch neu um das als fehlerquelle auszuschließen.
hier mein neues configure:

Code: Select all

rubidium suphp-0.5.2 # ./configure --with-php=/usr/bin/php --prefix=/usr --with-apache-user=apache --with-logfile=/var/log/apache2/suphp.log --with-apxs=/usr/sbin/apxs2
Vielen Dank für jede Hilfe

P.S.: der existierende suphp_log ist wo es mal geklappt hatte, aber dann kam immer dieses "Premature..." :cry:

EDIT:
Nun sieht es so aus:

Code: Select all

[Mon Jul 26 11:41:15 2004] [info] (104)Connection reset by peer: core_output_filter: writing data to the network
[Mon Jul 26 11:41:16 2004] [error] [client 80.142.73.86] Premature end of script headers: index.php, referer: http://www.hotel-teufelsmauer.de
suphplog

Code: Select all

[Mon Jul 26 11:46:49 2004] [info] Executing /var/www/localhost/htdocs/web3/html/index.php as user web3 (654), group ftponly (501)
lafarik
Posts: 31
Joined: 2003-06-17 16:38
 

Re: Apache2, suPHP und mod_php

Post by lafarik »

Hallo Leute!

Gibt es irgendwo eine gute HowTo wie man suPHP paralell zu modPHP auf einem Apache2 System installiert?

Danke im vorraus.
Gruß
sascha
Posts: 1325
Joined: 2002-04-22 23:08
 

Re: Apache2, suPHP und mod_php

Post by sascha »

debianhowto.de
Post Reply