Project

General

Profile

[Solved] Setting up fast-cgi

Added by chestnut 9 days ago

I would like to utilize the fast-cgi interface to connect to lighttpd.
Lighttpd 1.4.77 is installed on a linux computer, listening on port 80.
The application code meant to process the web pages is on a Windows
computer, listening on port 8080. Right now, the code is just listening
on port 8080 and will display a message on a Windows clipboard, no return
of web pages has been programmed yet. This first attempt is just to
validate network traffic is reaching the Windows application.

After going through the suggested reading, I am not understanding something
basic to making this work.
My understanding at a high level is as follows:

1) lighttpd has a built-in module, called mod_fastcgi
2) lighttpd is configured to load mod_fastcgi upon startup
3) lighttpd is configured using fastcgi.server options to point to
application code which receives all web requests, processes, and
returns the html page for lighttpd to display to the client machine

What I have done to try to make this work:
1) & 2)
In /etc/lighttpd/lighttpd.conf, added "mod_fastcgi" to the server.modules section
or
copied /etc/lighttpd/conf-available/10-fastcgi.conf to /etc/lighttpd/conf-enabled/Link to 10-fastcgi.conf

----Is there a way to tell if mod_fastcgi is actually loaded?

3)
In /etc/lighttpd/lighttpd.conf, added a section:
fastcgi.server = (
"/" =>
( ("host" => "192.168.1.55",
"port" => 8080
)) )

---- where 192.168.1.55 is the Windows computer with app listening on port 8080

When a web browser connects to lighttpd, lighttpd presents the html pages
back to the browser...but the expectation is the the Windows app would instead
be passed the incoming request by lighttpd, perform some processing, and send
the result back to lighttpd to be presented to the browser.
The reading material typically provides "fastcgi server" code written in Python,
C++. I presume my Windows app takes the place of that code. Also, cannot
really find instances where the app lives on a machine different to lighttpd and
is not one of Python, C++.


Replies (3)

RE: Setting up fast-cgi - Added by gstrauss 8 days ago

See mod_fastcgi "check-local" => "disable"

RE: Setting up fast-cgi - Added by chestnut 8 days ago

Yep, I tried that option also. Was one of the first ones used, realizing the code was
on a remote machine. Forgot to state that, as it is not in the current config.

RE: Setting up fast-cgi - Added by chestnut 8 days ago

Holy macaroni....tried it again...and it worked! I have been playing around with some network commands,
trying to determine if the port was available. Have no idea though, what combination of the "netcat"
variables made this happen. It might be "nc -l -p 8080".
Thanks for your help

    (1-3/3)