Project

General

Profile

How to configure 2 fastcgi.server's?

Added by Mazay about 14 years ago

I want to have two FastCGI processes - PHP and my own (simple FastCGI C++ service).
Here is my /etc/lighttpd/conf-enabled/10-fastcgi.conf :

server.modules   += ( "mod_fastcgi" )

## Start an FastCGI server for php (needs the php5-cgi package)
fastcgi.server    = (
".php" => 
    ( "localhost" =>
        (
            "bin-path" => "/usr/bin/php-cgi",
            "socket" => "/tmp/php.socket",
            "max-procs" => 2,
            "idle-timeout" => 20,
            "bin-environment" => ( 
                "PHP_FCGI_CHILDREN" => "4",
                "PHP_FCGI_MAX_REQUESTS" => "10000" 
            ),
            "bin-copy-environment" => (
                "PATH", "SHELL", "USER" 
            ),
            "broken-scriptfilename" => "enable" 
        ) 
    )
".fcgi" => 
    ( "localhost2" =>
        (
            "bin-path" => "/home/mazay/prg/fcgi-2.4.0/examples/.libs/echo-cpp",
            "socket" => "/tmp/echo.socket",
            "check-local" => "disable",
            "max-procs" => 5
        )
    )
)

But it can't be parsed by server:
sudo /etc/init.d/lighttpd restart
2011-03-28 12:41:10: (configfile.c.864) source: /etc/lighttpd/conf-enabled/10-fastcgi.conf line: 29 pos: 9 parser failed somehow near here: .fcgi 
2011-03-28 12:41:10: (configfile.c.864) source: /usr/share/lighttpd/include-conf-enabled.pl line: 2 pos: 1 parser failed somehow near here: (EOL) 
2011-03-28 12:41:10: (configfile.c.864) source: /etc/lighttpd/lighttpd.conf line: 158 pos: 1 parser failed somehow near here: (EOL) 

When I remove either ".php" => (...) or ".fcgi" => (...) section, the remained service works fine (echo-cpp or PHP respectivly).
You can look at my /etc/lighttpd/lighttpd.conf here http://paste.lighttpd.net/1570 , but I do not think that there is something relevant to the problem.

The lighttpd server works on Ubuntu Karmic 9.10 x86_64 kernel 2.6.31-23-generic.
Lighttpd installed from Ubuntu repos, version 1.4.22-1ubuntu4

In other words:
uname -a
Linux mzh 2.6.31-23-generic #74-Ubuntu SMP Mon Feb 28 22:20:11 UTC 2011 x86_64 GNU/Linux

lighttpd -v
lighttpd-1.4.22 (ssl) - a light and fast webserver
Build-Date: Oct 10 2009 01:07:43

I have managed to find only one example of config file for multiple fcgi services: https://wiki.archlinux.org/index.php/Lighttpd_and_FastCGI#Configuration_of_.2Fetc.2Flighttpd.2Flighttpd.

But it seems that this approach doesn't work. Can you show me the correct way?


Replies (1)

RE: How to configure 2 fastcgi.server's? - Added by Olaf-van-der-Spek about 14 years ago

Missing comma before ".fcgi"

    (1-1/1)