Seite 1 von 1

colubrid, flup und lighttpd

Verfasst: Montag 23. April 2007, 09:56
von monocult
Hallo,

Ich versuche eine Colubrid Applikation unter lighttpd zu nutzen. Ich steh aber irgendwie auf der Leitung. Im Netz finden sich dafür kaum Anleitungen(oder ich verstehe sie nicht)

Ich habs mit folgender Konfiguration versucht.

Ich bin über jede Hilfe Dankbar.


lighttpd.conf

Code: Alles auswählen

server.document-root = "/home/monocult/web"
server.modules = ("mod_fastcgi")
fastcgi.server = ( "/" =>
 (( "socket" => "/tmp/fastcgi.socket",
    "bin-path" => "/home/monocult/web/handler.fcgi"
 ))
)
handler.fcgi

Code: Alles auswählen

#!/usr/bin/python
# -*- coding: utf-8 -*-

from flup.server.fcgi import WSGIServer
from index import MyApplication
WSGIServer(MyApplication).run() 
index.py

Code: Alles auswählen

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from colubrid import BaseApplication, HttpResponse, execute

class MyApplication(BaseApplication):

    def process_request(self):
        name = self.request.args.get('name', 'World')
        response = HttpResponse('Hello %s!' % name)
        response['Content-Type'] = 'text/plain'
        return response

app = MyApplication

if __name__ == '__main__':
    execute(app)
lighttpd fehlermeldung

Code: Alles auswählen

monocult@metropolis:~$ sudo /etc/init.d/lighttpd restart
 * Stopping web server lighttpd                                          [ OK ] 
 * Starting web server lighttpd                                          [ OK ] 
monocult@metropolis:~$ 2007-04-23 10:51:29: (mod_fastcgi.c.1032) the fastcgi-backend /home/monocult/web/handler.fcgi failed to start: 
2007-04-23 10:51:29: (mod_fastcgi.c.1036) child exited with status 9 /home/monocult/web/handler.fcgi 
2007-04-23 10:51:29: (mod_fastcgi.c.1039) if you try do run PHP as FastCGI backend make sure you use the FastCGI enabled version.
You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' in the output, NOT (cgi) NOR (cli)
For more information check http://www.lighttpd.net/documentation/fastcgi.html#preparing-php-as-a-fastcgi-program 
2007-04-23 10:51:29: (mod_fastcgi.c.1044) If this is PHP on Gentoo add fastcgi to the USE flags 
2007-04-23 10:51:29: (mod_fastcgi.c.1340) [ERROR]: spawning fcgi failed. 
2007-04-23 10:51:29: (server.c.849) Configuration of plugins failed. Going down. 

Verfasst: Montag 23. April 2007, 12:20
von mitsuhiko
Lighttpd kann von sich aus keine FastCGI Server starten. Da musst du dir ein Shellscript basteln, dass den FastCGI Server als Demon startet.
Oder du nimmst einfach den Apachen, da funktioniert das einfacher :D

Verfasst: Montag 23. April 2007, 14:10
von monocult
blackbird hat geschrieben:Lighttpd kann von sich aus keine FastCGI Server starten. Da musst du dir ein Shellscript basteln, dass den FastCGI Server als Demon startet.
Oder du nimmst einfach den Apachen, da funktioniert das einfacher :D
mmm, lighttpd ist mir eigendlich lieber, Du hast nicht ein beispiel zufig ein beispiel :)

Verfasst: Montag 23. April 2007, 15:05
von mitsuhiko
Nein. Musst du im Lighttpd Wiki nachsehen. Verwende es selber nicht mehr.

Verfasst: Samstag 28. April 2007, 18:06
von Leonidas
blackbird hat geschrieben:Lighttpd kann von sich aus keine FastCGI Server starten.
Doch, läuft bei mir schon seit immer so. Hab die Anleitung aus den Django-Docs verwendet.

blackbird: Warum nutzt du Lighttpd nicht mehr?