Page 1 of 1

lighttpd und selfcompiled php

Posted: 2006-07-24 15:28
by woifi
hi!

ich habe eine testkiste auf der apache2 und php5 als fastcgi nach dem debianhowto prinzip läuft. um ein paar performancetests auszuführen habe ich heute dazu parallel lighttpd auf port 81 installiert (es handelt sich um eine ubuntu 6.06 server installation, apache2 und lighttpd aus dem repository installiert).

leider kann ich lighttpd nicht dazu überreden mein php-fcgi binary zu verwenden, mein fastcgi.conf sieht wie folgt aus

Code: Select all

fastcgi.server = (
                ".php" =>
                    ( "localhost" =>
                        (
                            "bin-path" => "/home/woifi/php-version/php-5.1.4/bin/php-fcgi -c /var/www/vhost1/conf/php.ini",
                            "port" => 9000,
                            "bin-environment" => (
                            "PHP_FCGI_CHILDREN" => "4",
                            "PHP_FCGI_MAX_REQUESTS" => "5000"
                                                 )
                        )
                    )
                 )
die pfade wurden mehrmals überprüft, fastcgi ist geladen.

lighttpd bietet mir die index.php als download an, wenn ich sie aufrufen möchte, mit apache2 funktioniert alles bestens.

any ideas?

bye

woifi

Re: lighttpd und selfcompiled php

Posted: 2006-07-24 15:53
by thorsten
Müßte anstelle von Port nicht "socket" => "/tmp/php.socket" dort stehen?
Vergleich mal:
http://trac.lighttpd.net/trac/wiki/Tuto ... ttpdAndPHP

Re: lighttpd und selfcompiled php

Posted: 2006-07-24 16:09
by woifi
Ich denke, dass beide Varianten möglich sind. Wenn ich's über Socket machen will, startet allerdings der Server nicht (/etc/init.d/lighttpd meldet zwar [ ok ], der Server läuft allerdings nicht und ein restart ergibt auch ein [fail].

Lustigerweise findet man rein gar nichts im error.log:
...
2006-07-24 13:58:59: (log.c.135) server stopped
2006-07-24 13:59:01: (log.c.75) server started
2006-07-24 14:01:37: (log.c.135) server stopped
2006-07-24 14:04:28: (log.c.75) server started
2006-07-24 16:04:10: (log.c.135) server stopped
...
noch ideen?

Re: lighttpd und selfcompiled php

Posted: 2006-07-25 03:55
by lord_pinhead
Also als Beispiel, eine interne Adresse in meinem LH

Code: Select all

$HTTP["host"] == "test.intranet" {
server.indexfiles = ( "index.php", "index.html" )
server.document-root        = "/var/www/virts/test/"
        fastcgi.server             = ( ".php" =>
                ( "localhost" =>
                        (
                                "socket" => "/tmp/php-fastcgi.socket",
                                "bin-path" => "/usr/bin/php4-cgi"
                        )
                )
        )
}

Vielleicht mal etwas vergleichen ;)

Re: lighttpd und selfcompiled php

Posted: 2006-07-25 14:01
by woifi
legt ihr das socket file selber an, oder soll das von php erstellt werden?

Re: lighttpd und selfcompiled php

Posted: 2006-07-25 14:56
by thorsten
dasfile wird selbsttätig angelegt.

Ich habe das fcgi-setup auch so wie Lord_Pinhead - stammt aus der Beispielconfig.

Re: lighttpd und selfcompiled php

Posted: 2006-07-25 15:18
by oxygen
vielleicht machst du mal strace lighttpd das ist manchmal recht aufschlussreich. ich hab damit schon einige Fehler ala Permission Denied oÄ gefunden, die sonst in keinem logfile zu finden waren.

Re: lighttpd und selfcompiled php

Posted: 2006-07-25 16:18
by woifi
ich habe inzwischen schon php5-cgi aus dem repository installiert -> leider bringt das auch keine besserung :(

auch strace liefert mir imho leider keine brauchbaren informationen. ich dachte auch, dass es mit den rechten wo hakt, allerdings glaub ich jetzt mit dem php5-cgi aus dem repo nicht mehr wirklich dran...

hier meine komplette jetzige config, vllt. fällt jemanden was ein:

Code: Select all

server.modules              = (
            "mod_access",
            "mod_alias",
            "mod_accesslog",
            "mod_fastcgi",
 )

server.document-root       = "/var/www/"
server.errorlog            = "/var/log/lighttpd/error.log"
index-file.names           = ( "index.php", "index.html", "index.htm")
accesslog.filename         = "/var/log/lighttpd/access.log"
url.access-deny            = ( "~", ".inc" )
server.port               = 81
server.pid-file            = "/var/run/lighttpd.pid"
dir-listing.encoding        = "utf-8"
server.dir-listing          = "enable"

mimetype.assign = (
    ".ico"     => "image/x-icon",
    ".jpeg"    => "image/jpeg",
    ".jpg"     => "image/jpeg",
    ".png"     => "image/png",
    ".gif"     => "image/gif",
    ".html"    => "text/html",
    ".htm"     => "text/html",
    ".css"     => "text/css",
    ".js"      => "text/javascript",
    ".php"     => "application/x-httpd-php",
    ""         => "text/plain"
)

server.username            = "www-data"
server.groupname           = "www-data"
alias.url = ("___invalid___" => "___invalid___")

$HTTP["host"] == "10.17.1.18" {
server.indexfiles = ( "index.php", "index.html" )
server.document-root        = "/var/www/vhost1/web/"
        fastcgi.server             = ( ".php" =>
                ( "localhost" =>
                        (
                                "socket" => "/tmp/php-fastcgi.socket",
                                "bin-path" => "/usr/bin/php5-cgi"
                        )
                )
        )
}