SuPHP

Apache, Lighttpd, nginx, Cherokee
Post Reply
blnsnoopy26
Posts: 660
Joined: 2002-10-19 14:01
 

SuPHP

Post by blnsnoopy26 »

Hi,

Ich weiss nicht, ob das schon jemand hatte, aber im Forum Fand ich hier dazu nix.

Und zwar, wenn ich das modul SuPHP aktiviere, dann bekomme ich auf allen phpscripts ein Internal Server Error Wenn ich das Modul wieder aus mache, dann ist alles wie gehabt.

Woran könnte das liegen?
jamesb
Posts: 661
Joined: 2002-05-08 15:35
Location: Karlsruhe
Contact:
 

Re: SuPHP

Post by jamesb »

Was sagen die Log-Dateien?

JamesB
blnsnoopy26
Posts: 660
Joined: 2002-10-19 14:01
 

Re: SuPHP

Post by blnsnoopy26 »

Die suphp.log sagte folgendes:

Code: Select all

[Sat Feb 07 16:49:37 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:38 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:39 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:39 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:40 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:41 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:41 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:42 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:42 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:43 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:44 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:44 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:45 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:49 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:50 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:50 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:51 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:52 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:53 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:49:53 2004] [error] UID of /home/sqladmin/index.php or its target (0 / root) < 30
[Sat Feb 07 16:51:17 2004] [info] Executing /home/confixx/html/not/index.php as user confixx (1031), group co
[Sat Feb 07 16:51:17 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:52:27 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:52:27 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:52:32 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:52:32 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:52:33 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:52:33 2004] [error] System error: execl() failed (No such file or directory)

[Sat Feb 07 16:52:33 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:52:33 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:54:01 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:54:01 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:54:01 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:54:01 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:54:03 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:54:03 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:54:04 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:54:04 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:54:05 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:54:05 2004] [error] System error: execl() failed (No such file or directory)
[Sat Feb 07 16:59:02 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:09 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:10 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:11 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:12 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:13 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:14 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:15 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:16 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:17 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 16:59:18 2004] [error] UID of /home/www/web1/wi/index.php or its target (0 / root) < 30
[Sat Feb 07 17:02:36 2004] [error] UID of /home/www/web2/html/phpinfo.php or its target (0 / root) < 30
[Sat Feb 07 17:04:13 2004] [error] UID of /home/www/web2/html/phpinfo.php or its target (0 / root) < 30
[Sat Feb 07 17:04:14 2004] [error] UID of /home/www/web2/html/phpinfo.php or its target (0 / root) < 30
[Sat Feb 07 17:04:15 2004] [error] UID of /home/www/web2/html/phpinfo.php or its target (0 / root) < 30
In den anderen logs steht nix.
Also ich habe überall das suphp aktiviert wo es an sein sollte ausser bei confixx, aber wie gesagt da kommt dann ein Internal Server Error!

Der sagt da zwar die datei gibs nicht oder den Ordner, aber ist dennoch alles vorhanden und wie gesagt mache ich suphp aus, dann funzt alles normal!

compiled habe ich das suphp so:

Code: Select all

./configure --with-min-uid=30 --with-min-gid=30 --with-apache-user=wwwrun --with-php=/usr/lib/cgi-bin/php4 --with-logfile=/var/log/suphp.log --with-apxs=/usr/bin/apxs 
Last edited by blnsnoopy26 on 2004-02-07 17:51, edited 1 time in total.
oxygen
Posts: 2138
Joined: 2002-12-15 00:10
Location: Bergheim
 

Re: SuPHP

Post by oxygen »

Da stehen doch die Fehlermeldungen. Die Datei gehören dem falschen User (root statt web1)
blnsnoopy26
Posts: 660
Joined: 2002-10-19 14:01
 

Re: SuPHP

Post by blnsnoopy26 »

øxygen wrote:Da stehen doch die Fehlermeldungen. Die Datei gehören dem falschen User (root statt web1)
Mir geht es ja mehr um das:
[Sat Feb 07 16:54:03 2004] [info] Executing /home/www/web3/html/index.php as user web3 (1039), group ftponly
[Sat Feb 07 16:54:03 2004] [error] System error: execl() failed (No such file or directory)
Das mit root ist schon klar, aber bei den web usern solte es normal gehen, aber geht ja nicht.

Aber ich denke mal weil das hier Fehlt:


./configure --with-min-uid=30 --with-min-gid=30 --with-apache-user=wwwrun --with-php=/usr/lib/cgi-bin/php4 --with-logfile=/var/log/suphp.log --with-apxs=/usr/bin/apxs


weil es das --with-php=/usr/lib/cgi-bin/php4 garnicht vorhanden ist.
oder muss ich das php binary extra ins cgi-bin verzeichnis jedes einzelnen users packen?

Aber ich habe auch schon einen chown gemacht auf das ganze verzeichnis und dateien, damit der user die rechte hat,aber half ja auch leider nix.
wgot
Posts: 1675
Joined: 2003-07-06 02:03
 

Re: SuPHP

Post by wgot »

Hallo,
blnsnoopy26 wrote: weil es das --with-php=/usr/lib/cgi-bin/php4 garnicht vorhanden ist.
dann leg das Verzeichnis an und kopier das PHP-Binary da rein oder compilier suphp neu mit dem Pfad den Du haben möchtest.

gruß, Wolfgang
blnsnoopy26
Posts: 660
Joined: 2002-10-19 14:01
 

Re: SuPHP

Post by blnsnoopy26 »

jo habe grad nochmal die hilfe angesehn und habe es mit /usr/bin/php
compiled wo auch php liegt und mal sehn ob es nu geht
blnsnoopy26
Posts: 660
Joined: 2002-10-19 14:01
 

Re: SuPHP

Post by blnsnoopy26 »

Ne hat leider auch nichts gebracht :(
Es bleibt bei einem Internal Server Error :(
blnsnoopy26
Posts: 660
Joined: 2002-10-19 14:01
 

Re: SuPHP

Post by blnsnoopy26 »

Jaaaaaaaaaaaaaaaaaaaaaaaaa es geht nun :) :) :)
Ich habe es jetzt mal nach einer Anleitung aus dem Confixx Forum gemacht und nun geht es auch wunderbar *freu*

Code: Select all

[Sun Feb 08 14:06:19 2004] [info] Executing /home/www/web1/xxxx/index.php as user web1 (1036), group ftponly (103)
[Sun Feb 08 14:06:50 2004] [info] Executing /home/www/web1/xxxx/start.php as user web1 (1036), group ftponly (103)
[Sun Feb 08 14:06:51 2004] [info] Executing /home/www/web1/xxxx/index.php as user web1 (1036), group ftponly (103)
[Sun Feb 08 14:06:59 2004] [info] Executing /home/www/web1/xxxx/start.php as user web1 (1036), group ftponly (103)
So sollte es sein und funzt nun tadellos :)
und ein php -v ergab

Code: Select all

PHP 4.3.4 (cgi) (built: Feb  8 2004 13:24:10)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
    with Zend Extension Manager v1.0.0, Copyright (c) 2003, by Zend Technologies
    with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend Technologies
das php nun auch als CGI läuft :-D :)
Und nun konnte ich endlich das sudo aus meinen startscripten rausnehmen und auch die sudoers die Zeilen löschen, denn jetzt läuft mein Gameserver, wenn ich ihn über mein Webinterface starte nicht mehr als Root sondern als web1 Benutzer :)

Und soweit ich hier mitbekommen habe ist das ja auch die sicherste variante, denn bisher lief mein Server immer als Root, was ja eine Sicherheitslücke darstellte, aber daher ich nun suPHP hinbekommen habe dürfte diese lücke gestopft sein :)

Nach dem Debian Howto hat es leider nicht geklappt mit suPHP und wie ich da sagte bekam ich immer einen Internal Server Error und nix ging, aber wer vor so einem ähnlichen Problem steht, der kann mal hier nachlesen:

http://www.confixx-forum.de/forum/showt ... ight=suphp

Nach der Anleitung hat es bei mir wunderbar geklappt.
So und nu bin ich auch zufrieden das alles so läuft wie es sollte :)
Post Reply