Project

General

Profile

[Solved] How to set up an application program to communicate with lighttpd?

Added by chestnut 19 days ago

I am new to lighttpd and web servers in general. Have managed to set up V1.4.77 on a Debian V12 computer. Would like to have lighttpd communicate with a Pascal-based program (created by Lazarus IDE) as a proof-of-concept before doing further development. I have read that it is possible to run compiled programs which perform the 'heavy lifting' external to the web server. If there are specific ways to do this, please let me know. Would like to minimize any overhead regarding opening/closing sessions or communications. Some sort of continuous connection(s) would be preferred. The application code of the compiled programs would include primarily database calls. There is no expectation of transferring large files, nor streaming. At the moment this is a part-time project for me. Hope I have provided enough information to determine if this is even feasible.


Replies (2)

RE: How to set up an application program to communicate with lighttpd? - Added by gstrauss 19 days ago

mod_cgi CGI is the historical answer (and among the least efficient, but often fast enough in practice).
mod_scgi SCGI is the simplest protocol to connect to a backend server.
mod_fastcgi FastCGI is also a solid protocol to connect to a backend server.
mod_proxy proxying to a backend using the HTTP protocol is another option.

There are a myriad of additional ways, but you should understand the basics of the above popular solutions before attempting anything more esoteric.

You should avoid premature optimization. Leave optimization alone until after you have a working solution.

RE: How to set up an application program to communicate with lighttpd? - Added by chestnut 19 days ago

Thanks for the links, direction and advice, in such quick order. Looks like the documentaion is based on fastcgi, so will likely investigate that and scgi first. Not likely to attempt more esoteric solutions. Getting either choice to work with decent performance will be enough of a challenge. Optimization would be really far down the road. I tend to leave default values in place for a while, especially for technology which I am not familiar with. I have done a lot of performance tuning with technologies I am very familiar with, and even then...challenging. The initial goal is just to have an end-to-end solution.

    (1-2/2)