[REBOL] Another FastCGI observations ...
From: petr::krenzelok::trz::cz at: 6-Jul-2001 19:36
Hi,
as simple things should be simple, I found out following:
1) comment ScriptAlias directive, it overrides some things and you can't get
clear results ...
my config is:
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi
both in global context
Then .cgi and .fcgi suffixes are registered globally with cgi-script and
fastcgi-script handlers ...
2) If you want to add ability to execute scripts to some directory, do so
inside of directory directive:
<Directory "/home/asko/public_html/cgi-bin">
Options ExecCGI
.... some other stuff you need ...
<Directory>
Then, once you are in Linux, your set-up will work in default - fastcgi
dynamic mode. Apache will start your apps dynamically. You can easily test
it (my test.fcgi script):
#!/usr/bin/rebolcmd -cs
REBOL []
print "Content-type: text/plain"
print ""
print "FastCGI test cript..."
print mold system/options/cgi
if not value? 'ble [ble: 0]
ble: ble + 1
print ble
Once I will reload my page, I can see 1, 2, 3, 4 ... numbers, so I can be
sure, the script doesn't run in CGI mode
3) If you want static set-up, you can add following line:
FastCgiServer "/home/asko/public_html/cgi-bin/test.fcgi" - processes 5
Above example will start 5 Rebol processes for test.fcgi script (= server -
I finally know what they mean by "server" ;-)
4) FastCgiExternalServer "/home/asko/cgi-bin" -host localhost:7000
If you add above line, you will make Apache to connect to externally running
Rebol task, listening on port 7000. The beauty is, that you can write in
your browser following:
http://www.rebol.cz/~asko/cgi-bin/some-non-existent-script.fcgi, and Apache
will forward your request to your listening task. Heh, hacker would be
probably surprised, if he would steal your machine, and found out, there are
no scripts, only connection to machine behind your firewall :-)
PS: of course, take my observations easy, I can be easily wrong :-)
Cheers,
-pekr-