From owner-freebsd-ports@FreeBSD.ORG Sat Sep 5 14:17:08 2009 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93E1F1065670 for ; Sat, 5 Sep 2009 14:17:08 +0000 (UTC) (envelope-from talon@lpthe.jussieu.fr) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.freebsd.org (Postfix) with ESMTP id 2AAD38FC1C for ; Sat, 5 Sep 2009 14:17:07 +0000 (UTC) Received: from parthe.lpthe.jussieu.fr (parthe.lpthe.jussieu.fr [134.157.10.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id n85DlCGW080187 ; Sat, 5 Sep 2009 15:47:12 +0200 (CEST) X-Ids: 165 Received: from niobe.lpthe.jussieu.fr (niobe.lpthe.jussieu.fr [134.157.10.41]) by parthe.lpthe.jussieu.fr (Postfix) with ESMTP id 2D9A289C58; Sat, 5 Sep 2009 15:47:11 +0200 (CEST) Received: by niobe.lpthe.jussieu.fr (Postfix, from userid 2005) id 222C916B; Sat, 5 Sep 2009 15:47:11 +0200 (CEST) Date: Sat, 5 Sep 2009 15:47:11 +0200 From: Michel Talon To: freebsd-ports@FreeBSD.org Message-ID: <20090905134711.GA95775@lpthe.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV 0.94.2/9777/Sat Sep 5 00:17:01 2009 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail2.jussieu.fr with ID 4AA26BE0.005 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 4AA26BE0.005/134.157.10.1/parthe.lpthe.jussieu.fr/parthe.lpthe.jussieu.fr/ Cc: ohartman@zedat.fu-berlin.de Subject: Re: Lighttpd: (mod_fastcgi.c.1742) connect failed X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Sep 2009 14:17:08 -0000 O. Hartmann wrote: > 2009-09-03 19:47:49: (mod_fastcgi.c.1742) connect failed: Connection > refused on unix:/tmp/lighttpd-fastcgi-php.socket-7 Have you checked the permissions? I seem to remember i had the same problem once with lighttpd and it was because permissions of the socket under /tmp. Now my server works OK since ages. I had to take provisions for permissions in the fastcgi python responder. In my case the relevant bits are when daemonizing the responder: pid = os.fork() if pid > 0 : # In first child import time time.sleep(3) while not os.access(socket, os.F_OK) : time.sleep(1) # the socket created by the child is made accessible to the web # server os.chown(socket, wwwuid, wwwgid) os.chmod(socket, 0700) sys.exit(0) # Exit first child .... While still being root i adjust the permissions of the socket. Then i change effective userid: ..... # And finally the routine which starts the fcgi responder, as user www os.seteuid(wwwuid) WSGIServer(request_handler, **wsgi_opts).run() .... The complete script you can get at: http://www.lpthe.jussieu.fr/~talon/show_index.fcgi It is a simpler server than for example django if you want to understand fastcgi. By the way the aim is to display the FreeBSD ports trough a fastcgi responder. -- Michel TALON