[fpc-pascal] SCGI in Pascal?

silvioprog silvioprog at gmail.com
Mon Jan 26 19:32:34 CET 2015


On Mon, Jan 19, 2015 at 7:17 PM, Michael Van Canneyt <michael at freepascal.org
> wrote:
>
> On Mon, 19 Jan 2015, silvioprog wrote:
>
>> Hello,
>> Can any one inform if exists a FPC or Delphi implementation to this
>> protocol [1]?
>>
>> Thank you!
>>
>> [1] - http://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface
>>
>
> I haven't found any.
>
> Michael.


Hm... =/

I found a project written in Java. Tested with Apache on Windows and worked
fine (and very fast like FastCGI).

The project is:

https://github.com/intrbiz/balsa-scgi

I saw the sources of this project and it seems very simple to implement it
in FPC using the HTTPDefs/sscokets unit.

The SCGI protocol is simple like CGI and fast like FastCGI, and very easy
to configure in several popular HTTP servers (tested in Apache) like
Apache, nginx, Lighttpd, M$ IIS etc. My steps in Apache on Windows 7:

1. download and install the "httpd-2.2.22-win32-x86-openssl-0.9.8t.msi"
file from https://archive.apache.org/dist/httpd/binaries/win32/ ;
2. download the "scgi-1.13-apache-2.2.13.zip" file from
https://sites.google.com/site/bigonez/ ;
3. copy the "mod_scgi.so" from "scgi-1.13-apache-2.2.13.zip" to the
"C:\YOUR_APACHE_FOLDER\modules" folder;
4. in your "C:\YOUR_APACHE_FOLDER\conf\httpd.conf" file, add the lines:
  LoadModule scgi_module modules/mod_scgi.so
  SCGIMount /teste 127.0.0.1:8080 ;
5. restart your Apache.

Download Balsa SCGI from https://github.com/intrbiz/balsa-scgi and open it
in your favorite IDE, like Intellij IDEA, Eclipse, NetBeans etc., I use
Intellij IDEA. In SCGIExample.java, change the "port = 8090" to "port =
8080", run the app and in your browser, open: http://localhost/test.

See a screen shot of my test in attached.

SCGI can be a nice alternative to FastCGI (and FPC could be added in
"Language bindings for the SCGI API" -
http://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface).

-- 
Silvio Cl├ęcio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20150126/627fc852/attachment.html>


More information about the fpc-pascal mailing list