Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Testing REBOL CGI under Win95

 [1/13] from: geza67::freestart::hu at: 9-Jun-2001 17:02


Hello REBOLlion ! I played a hard time to test REBOL CGI scripts under Win95: After trying several CGI-able free Web-servers, it just did not happen to succesfully launch any REBOL CGI scripts (BTW Perl scripts runned like a breeze :-(( ) . What is the catch ? I suspect that the Windows Registry file assocation info which has bern put by REBOL View 1.2 installation, is not satisfactory to launch CGI. I also tried to hand-code and assoc-info line with "C:\path-to-rebol\rebol.exe -cs %'" and deleting the other automatically generated ones. I also installed Core 2.5, maybe WinXX does not like View for this purpose ... but ended up with the same resultlessness ;-) Could someone please help, who entered the similar one-way street ? P.S. Maybe I should put a mini-Linux distribution on my PC and hack with the loads of configuration options of the Apache executable just this minimalist sake ? Thanks for your reactions. Geza Lakner MD

 [2/13] from: gjones05:mail:orion at: 9-Jun-2001 12:07


From: Geza Lakner
> Hello REBOLlion ! > > I played a hard time to test REBOL CGI scripts under > Win95: After trying several CGI-able free Web-servers, > it just did not happen to succesfully launch any REBOL > CGI scripts (BTW Perl scripts runned like a breeze :-(( ) .
And read like hell! ;-)
> What is the catch ? I suspect that the Windows Registry > file assocation info which has bern put by REBOL View
<<quoted lines omitted: 6>>
> Could someone please help, who entered the > similar one-way street ?
Which servers have you used? Is there one in particular that you would like to use? The configuration is usually different for each one.
> P.S. Maybe I should put a mini-Linux distribution > on my PC and hack with the loads of configuration > options of the Apache executable just this > minimalist sake ? > > Thanks for your reactions.
Not that I have anything against Linux, but Apache runs quite well on Windows these days. It is what I have been using for almost two years now on Win95 and then Win98. But it does require more than its share of configurations. The upside is that there are more of us to guide you through it. First, which servers have you tried? --Scott Jones

 [3/13] from: geza67:freestart:hu at: 10-Jun-2001 21:57


Hi Scott !
>> CGI scripts (BTW Perl scripts runned like a breeze :-(( ) . >And read like hell! ;-)
;-))
>Which servers have you used? Is there one in particular that you would >like to use? The configuration is usually different for each one.
TinyWeb Apache (after a half hour of MISconfiguration ;-) efforts I gave up and removed the app.) AnalogX Simpleserver Savant
>Not that I have anything against Linux, but Apache runs quite well on >Windows these days. It is what I have been using for almost two years now >on Win95 and then Win98. But it does require more than its share of
Would you mind to send me some of your config files (or just the relevant snippets to setup CGI correctly) ? I really don't want anything "secure" and complicated, just to test REBOL CGI at home while watching TV and eating a slice of pizza with some beer(THAT is multitasking ...) :-))) Bye Geza Lakner

 [4/13] from: gjones05:mail:orion at: 10-Jun-2001 15:54


From: <[geza67--freestart--hu]> SJ> >Which servers have you used? Is there one in particular that you would SJ> >like to use? The configuration is usually different for each one.
> TinyWeb > Apache (after a half hour of MISconfiguration ;-) efforts > I gave up and removed the app.) > AnalogX Simpleserver > Savant
I can only help with Apache. Anyone else familiar with the others???
> Would you mind to send me some of your config files > (or just the relevant snippets to setup CGI correctly) ? > I really don't want anything "secure" and complicated, > just to test REBOL CGI at home while watching TV and > eating a slice of pizza with some beer(THAT is multitasking ...) :-)))
Sure! First, let us see if someone can help with one of the simpler servers. Apache is pretty much over-kill, but it does the job. If there are no other helpful hints, I will get together a list of configuration file changes (I think I wrote this out once for the list ... I will look a little later.) Beer *and* pizza *and* watching TV, wow, you *are* a talented multitasker!! --Scott Jones

 [5/13] from: kenlo:umailme at: 11-Jun-2001 14:26


2001/6/9 PM 07:02:53, [geza67--freestart--hu] wrote:
>I played a hard time to test REBOL CGI scripts under Win95: >After trying several CGI-able free Web-servers,
You've mentioned AnalogX, apache and TinyWeb in another thread. I've tried all of them. A quickie on the results. 1. AnalogX 1.05 works fine with core 2.3. After I upgrade to core 2.5 it just got mad. You also need to do some tricky things with the registry. So forget about it. 2. Apache is absolutely OK. If you read the config instructions carefully you can find that all you have to do is to associate .r scripts (using file explorer) with /path/rebol.exe -cs. 3. TinyWeb can't work with rebol unless you recompile it. See the faq on the tinyweb site.

 [6/13] from: gjones05:mail:orion at: 11-Jun-2001 4:24


Hi, Geza, Looks like it will be Apache after all. I use Apache 1.3.14, but this should still work with a later addition, I hope! I went through my httpd.conf file to find anything relevant. I placed my comments in parenthesis for adding additional comments to Apache comments. Their comments are helpful, but sometimes leave out exactly how or why to do something, so I tried to add that back in. The httpd.conf file can now be conveniently reached from the Start menu On installing Apache the last time, I chose to install it in c:/apache, because if you install other packages like MySQL or PHP, this becomes *much* easier!!!! Also, if you change the configuration file while Apache is running, you must restart it (now conveniently included from Start menu). Sometimes this doesn't work on Windows version, so it is easier to stop then restart and be guaranteed that the changes will take affect. Good luck! --Scott Jones ======================== (1) # ServerType is either inetd, or standalone. Inetd mode is only supported on # Unix platforms. ServerType standalone (2) I now install it to /apache for simplicity of using outside packages, like PHP # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # # Do NOT add a slash at the end of the directory path. # ServerRoot "C:/Apache" (3)Leave these commented #ResourceConfig conf/srm.conf #AccessConfig conf/access.conf (4)Leave these commented # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, in addition to the default. See also the <VirtualHost> # directive. # #Listen 3000 #Listen 12.34.56.78:80 (5) I left mine on 80 # Port: The port to which the standalone server listens. Certain firewall # products must be configured before Apache can listen to a specific port. # Other running httpd servers will also interfere with this port. Disable # all firewall, security, and other services if you encounter problems. # To help diagnose problems use the Windows NT command NETSTAT -a # Port 80 (6) # 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your # machine always knows itself by this address. If you use Apache strictly for # local testing and development, you may use 127.0.0.1 as the server name. # #ServerName new.host.name ServerName 127.0.0.1 (7)You culd leave this pointing to the default and dump your html there or... # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # #DocumentRoot "C:/Apache/htdocs" DocumentRoot "C:/my-own-web-stuff/www" (8)Very important to set this to same as above # This should be changed to whatever you set DocumentRoot to. # #<Directory "C:/Apache/htdocs"> <Directory "C:/my-own-web-stuff/www"> (9) I added permission for ssi (.shtml stuff) and executable cgi # This may also be "None", "All", or any combination of "Indexes", # "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews". # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # Options Indexes FollowSymLinks MultiViews Options Indexes FollowSymLinks Includes ExecCGI MultiViews (10)This sets which file and extension is run by default if only a folder ()))name is give (like http://127.0.0.1/), the order is relevant ()))This example includes everything for experimental purposes # DirectoryIndex: Name of the file or files to use as a pre-written HTML # directory index. Separate multiple entries with spaces. # <IfModule mod_dir.c> DirectoryIndex index.html index.shtml index.php index.r </IfModule> (11) You will hear differences of opinions on this one!!! Here is what I do: # Each mechanism has it's own specific security weaknesses, from the means # to run a program you didn't intend the website owner to invoke, and the # best method is a matter of great debate. # # To enable the this Windows specific behavior (and therefore -disable- the # equivilant Unix behavior), uncomment the following directive: # #ScriptInterpreterSource registry # # The directive above can be placed in individual <Directory> blocks or the # .htaccess file, with either the 'registry' (Windows behavior) or 'script' # (Unix behavior) option, and will override this server default option. (12) Must be set to where ever you will place your scripts # ScriptAlias: This controls which directories contain server scripts. # ScriptAliases are essentially the same as Aliases, except that # documents in the realname directory are treated as applications and # run by the server when requested rather than as documents sent to the client. # The same rules about trailing "/" apply to ScriptAlias directives as to # Alias. # #ScriptAlias /cgi-bin/ "C:/Apache/cgi-bin/" ScriptAlias /cgi-bin/ "C:/my-own-web-stuff/www/cgi-bin/" (13) BTW, I always comment out defaults so I can remember the defaults!! ())) Notice lack of trailing "/" and I added ExecCGI here also # "C:/Apache/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # #<Directory "C:/Apache/cgi-bin"> # AllowOverride None # Options None # Order allow,deny # Allow from all #</Directory> <Directory "C:/my-own-web-stuff/www/cgi-bin"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> (14) I throw this example in to show how to set up an alias ())) Notice that the directory is different than above, but ())) html docs in this directory will be reached by ())) http://127.0.0.1/manual/ Does this make sense??? Alias /manual "C:/Apache/htdocs/manual" <Directory "C:/Apache/htdocs/manual"> Options Indexes FollowSymLinks Includes ExecCGI MultiViews AllowOverride None Order allow,deny Allow from all </Directory> (15))) Large gap - by the way I notice .hu is not included??? (16))) I also have left out all of my PHP stuff (17) You will get different opinions on this one. ())) For home experimentation, it doesn't really matter except ())) to be sure you include your script file ending, .r in this case ())) since you did not choose to let Windows Registry handle the association above # AddHandler allows you to map certain file extensions to "handlers", # actions unrelated to filetype. These can be either built into the server # or added with the Action command (see below) # # If you want to use server side includes, or CGI outside # ScriptAliased directories, uncomment the following lines. # # To use CGI scripts: # AddHandler cgi-script .cgi AddHandler cgi-script .r (18) Not really important for REBOL, but I uncommented for .shtml support # To use server-parsed HTML files # #AddType text/html .shtml #AddHandler server-parsed .shtml AddType text/html .shtml AddHandler server-parsed .shtml (19) I now do not remember why I included the following (must be the ())) prion disease creeping up on me ;-) ())) I believe that this allowed me to set up a folder that ran every ())) page as a rebol script. This can be safely ignored. If you ())) are really curious, I can dig out why I did this.... # End of browser customization directives <Location /local> ForceType application/x-httpd-r </Location> (20) Geza, I believe that that is all that is relavent.

 [7/13] from: gjones05:mail:orion at: 11-Jun-2001 4:36


Hi, again, Geza, By the way, I forgot to mention in the configuration email I sent earlier (which will probably show up after this one because of the email list server software) that it is helpful Be sure and add the following first line to your scripts: #!c:/path/to/rebol/rebol --cgi --secure or just #!c:/path/to/rebol/rebol -cs It is very helpful to place: print "Content-Type: text/html^/" very early in the script. If there is an error, it will allow the error information to be printed! Here is a very simple first script to try to be sure everything is working. Place this script in the cgi-bin directory and call it time.r. #!c:/path/to/rebol/rebol -cs REBOL [Title: "Time"] print "Content-Type: text/html^/" print ["The time is now" now/time] Be sure to start Apache, then in a browser, type: http://127.0.0.1/cgi-bin/time.r Good luck! --Scott Jones

 [8/13] from: sanghabum:aol at: 11-Jun-2001 5:53


Hi Scott, Geza,
> I went through my httpd.conf file to find anything relevant. I placed my > comments in parenthesis for adding additional comments to Apache comments. > Their comments are helpful, but sometimes leave out exactly how or why to
do
> something, so I tried to add that back in. The httpd.conf file can now be > conveniently reached from the Start menu <snip>
I installed Apache (1.3.19 running under Win/98), and made just the two changes that Andrew suggests in "Rebol: The Official Guide". Apache hasn't skipped beat since. His changes are: apache/conf/httpd.conf file: from: Options Indexes FollowSymLinks MultiViews to: Options Indexes FollowSymLinks MultiViews ExecCGI from: #AddHandler cgi-script .cgi to: AddHandler cgi-script .r (note uncommenting of second change) Hope that helps, Colin.

 [9/13] from: gjones05:mail:orion at: 11-Jun-2001 6:44


From: Colin
> I installed Apache (1.3.19 running under Win/98), and made just the two > changes that Andrew suggests in "Rebol: The Official Guide". Apache hasn't > skipped beat since. His changes are: ...
It is good to know that it can be just that simple. Thanks to you and RTOG. --Scott Jones

 [10/13] from: sanghabum:aol at: 11-Jun-2001 8:19


Hi Scott,
> > I installed Apache (1.3.19 running under Win/98), and made just the two > > changes that Andrew suggests in "Rebol: The Official Guide". Apache
hasn't
> > skipped beat since. His changes are: ... > > It is good to know that it can be just that simple. Thanks to you and
RTOG.
> --Scott Jones
But I've got some recovered memories of the installation ... and I did run into a couple of problems. Maybe these points below will help Gesa: 1. With these two simple changes, you must then put *.r scripts in ...\apache\cgi-bin 2. Assuming you install Rebol in ...\Apache\Rebol, then all your *.r scripts must start with the three lines: #!rebol/rebol.exe -csi rebol [] (The line in the middle is blank. I think that is important) 3. Don't use a word processor (MS/Word, or WordPerfect, or WordPad) to knock together a quick first-time script. Even if saved as ASCII, it won't have the correct line endings that Apache (which comes from the UNIX world) expects....Apache will misread the first line and dump a very misleading message onto the error log. If you have no other editor available, the DOS mode EDIT.EXE will save files in Apache-friendly ASCII. --Colin.

 [11/13] from: tim:johnsons-web at: 11-Jun-2001 11:34


On Sat, Jun 09, 2001 at 05:02:53PM +0200, [geza67--freestart--hu] wrote:
> Hello REBOLlion ! > I played a hard time to test REBOL CGI scripts under Win95: After trying several CGI-able free Web-servers,
<<quoted lines omitted: 6>>
> P.S. Maybe I should put a mini-Linux distribution on my PC and hack with the loads of configuration options of the > Apache executable just this minimalist sake ?
Hello Geza: What follows is directions for configuring PWS as worked for my on Windows NT 4.0. If you have win95 (as opposed to win98) you will have to get PWS from the Microsoft web site. I do my rebol CGI testing on Linux now, but if there is any advantage to PWS over Apache is that I found PWS very easy to install, and I didn't have to resolve any #!paths if my user target was a linux server. Directions follow: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> Add a new string value to: > HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\W3Svc\Parameters\Scri
<<quoted lines omitted: 11>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

 [12/13] from: geza67:freestart:hu at: 15-Jun-2001 18:10


Hi Tim, Scott and Kenneth !
> I went through my httpd.conf file to find anything relevant. I placed my
Thank you, Scott it was a very valuable presentation of the topic for all uf us in the list. ... BUT ... :
> Hello Geza: What follows is directions for configuring PWS as worked for my on Windows > NT 4.0. If you have win95 (as opposed to win98) you will have to get PWS from the
Tim's solution was WAY easier to implement. I really didn't know that a hidden gem could reside even in a WinXX distribution :-) Thank you, Tim - I feel really happy about this! :-) Cheers!

 [13/13] from: tim:johnsons-web at: 16-Jun-2001 18:33


On Fri, Jun 15, 2001 at 06:10:32PM +0200, [geza67--freestart--hu] wrote:
> Hi Tim, Scott and Kenneth ! > > I went through my httpd.conf file to find anything relevant. I placed my
<<quoted lines omitted: 5>>
> reside even in a WinXX distribution :-) > Thank you, Tim - I feel really happy about this! :-)
I am really happy to be of help. I owe a lot to this mailing list. It is among the best that I have used and is almost as much an asset as is the rebol language itself... tj
> Cheers! > > -- > To unsubscribe from this list, please send an email to > [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.johnsons-web.com

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted