World: r3wp
[CGI] web server issues
older newer | first last |
Volker 5-Jun-2005 [206] | Steve, now i read your question again, you are writing a complete web-server? Why not looking at one available? Patch %webserv.r to probe a bit. It also splits the stuff into system/options/cgi, so you can study how to do that. Only problem is with post-data, its system/ports/input works a bit different to a real webserver. You need to look in /content-length and use a copy/part instead of carls loop. and sometimes to set the right port-modes by hand IIRC. |
eFishAnt 5-Jun-2005 [207x3] | you mean Cal's loop, right, Volker? |
I have looked through that some, and I had read the comments in here earlier. | |
I was able to see some packets in ethereal (as a comms guy, I always dig through the communications messages to understand what happens, so starting to narrow that down. | |
Chris 1-Jul-2005 [210] | Anyone know a good resource on CHMOD and web folder permissions? Covering eg. what world-executable rights on a folder allows? |
Tomc 1-Jul-2005 [211x2] | it allows the directory to be entered/traversed by people who are not the owner of the dir or in the group the directory belongs in |
that is a directory may be "readable" but you still need to be able to open it to read it | |
Gabriele 1-Jul-2005 [213x3] | if a dir is readable but not "executable", you can list its contents but not access files in it. |
if x but not r you can access files in it but not list its contents | |
if both, you can access files in it and list its contents. | |
eFishAnt 3-Jul-2005 [216] | any good imagemap examples in REBOL? |
Anton 4-Jul-2005 [217x2] | for what purpose ? |
view layout [b: box 200x100 navy image help.gif feel [engage: func [face action event][if find [over down] action [b/text: mold pick face/image event/offset show b]]]] | |
eFishAnt 4-Jul-2005 [219] | aha, I meant CGI/HTML imagemap, rather than native View |
Anton 4-Jul-2005 [220] | ah ok.. sorry |
Carlos 4-Jul-2005 [221] | I ´d like to have a CGI script to filter my emails at server. My ISP uses Cpanel that gives the possibility of use this to send emails to file: |/home/user/cgi-bin/myfilter.cgi. The thing all I get is the whole content of each email appended to the CGI script. Anyone could help me? |
François 10-Jul-2005 [222] | I found a critical bug: when rebol is configured to work as cgi engine with SELinux (Security Enhanced Linux), it generates a Segmentation Fault. I uses Fedora Core 3 with SELinux to secure the httpd daemon. For now, if you want to use rebol as a cgi engine, you must disable SELinux. See RAMBO Ticket #-376 |
François 22-Jul-2005 [223x3] | Hi, I have some trouble to configure apache to use fastcgi with Rebol/Cmd. |
The documentation on rebol.com is really not clear and/or complete. Has anyone been successfull withj fastcgi? | |
I am using apache 2 with module fastcgi | |
François 24-Jul-2005 [226x2] | Hello, I finally get FastCGI with rebol/cmd with Lite Speed Web Server, but not with Apache. |
Anyway, it works, but I still have a problem: in system/options/cgi, both 'path-info and 'path-translated are set to none, which prevents Magic! to wrks properly as it can not find the requested file (usually a *.rhtml) file. In normal CGI, it works well. Is this a bug? In that case, I will put it into rambo. Note that I have configure FastCGI in compatibility mode. | |
François 25-Jul-2005 [228x3] | It looks like the problem does not come from the past-translated, but from the 'request-method: with CGI, the values are "GET" or "POST", but with FastCGI, the values are "GET^@^@^@^@" or "POST^@^@^@". But with lighttpd, no problem. So to make FastCGI rebol scripts work with LiteSpeed, we have to update the exemple http://www.rebol.com/docs/words/wread-io.html as: |
read-cgi: func [ "Read CGI form data from GET or POST." /local data buf ][ if found? find/any system/options/cgi/request-method "POST*" [ data: make string! 1020 buffer: make string! 16380 while [positive? read-io system/ports/input buffer 16380][ append data buffer clear buffer ] return data ] if found? find/any system/options/cgi/request-method "GET*" [ return system/options/cgi/query-string ] test-data ; if in test mode ] | |
LiteSpeed and lighttpd are both amazingly easy to install and configure and works fine with Rebol/Cmd in FastCGI (both in compatibility and external modes). Furthermore, those web servers are much faster and reponsive than Apache 2.0 (2 to 6 times faster!!) | |
Sunanda 25-Jul-2005 [231] | Nice research and summary -- It'd be a good idea to drop that change request to RAMBO. That way, it won't get lost http://www.rebol.net/cgi-bin/rambo.r |
François 25-Jul-2005 [232x9] | Done. I put this as a new issue : http://www.rebol.net/cgi-bin/rambo.r?id=-392& |
Reviewed RAMBO Ticket #3862 | |
Well, looks like there is a problem with system/options/cgi | |
With Apache 2.x (normal CGI), we have: make object! [ server-software: "Apache/2.0.54 (Fedora)" server-name: "localhost" gateway-interface: "CGI/1.1" server-protocol: "HTTP/1.1" server-port: "80" request-method: "GET" path-info: "/sample01.rhtml" path-translated: "/var/www/html/sample01.rhtml" script-name: "/cgi-bin/magic.cgi" query-string: "" remote-host: none remote-addr: "127.0.0.1" auth-type: none remote-user: none remote-ident: none Content-Type: none content-length: none other-headers: [ "HTTP_HOST" "localhost" "HTTP_USER_AGENT" {Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc4 Firefox/1.0.6} "HTTP_ACCEPT" {text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5} "HTTP_ACCEPT_LANGUAGE" "en-us,en;q=0.5" "HTTP_ACCEPT_ENCODING" "gzip,deflate" "HTTP_ACCEPT_CHARSET" "ISO-8859-1,utf-8;q=0.7,*;q=0.7" "HTTP_KEEP_ALIVE" "300" "HTTP_CONNECTION" "keep-alive" "HTTP_COOKIE" "PHPSESSID=7f84fd7766f23e1462fed550ecbbfda4" ] ] | |
With LiteServer and lighttpd (normal CCI and FastCGI) i have: make object! [ ... path-info: "" path-translated: none script-name: "/sample01.rhtml" ... ] | |
And with lighttpd: make object! [ ... path-info: none path-translated: none script-name: "/sample01.rhtml" ... ] | |
With lighttpd and LiteServer, both path-info and path-translated are missing, while 'script-name is the name of the originator html file instead of the name of the cgi script (magic.cgi). | |
So, the question is: is that a bug with rebol? | |
Rambo ticket submitted | |
François 6-Aug-2005 [241] | Can anyone help me to configure apache 2.0.x and rebol for FastCGI under Windows XP? |
Pekr 6-Aug-2005 [242x3] | yes, although I did it long time ago .... |
You should note, that Rebol fastCGI is incomplete (=crippled!), and so you can run FastCGI in External mode only, and I regard it being a BIG limitation. Pity DocKimbel did not release his FastCGI for Uniserve yet .... | |
I will try to find my config .conf and send it to you by email ... | |
François 6-Aug-2005 [245] | Hi Pekr, Rebol/Cmd works fine with lighttpd and LiteSpeed Web Servers. I configure succesfully those web servers to work with rebol/cmd as static server (i did not try as external server but this sould work too). But I did not succeed with Apache! |
Pekr 6-Aug-2005 [246x2] | Static is not good, I want dynamic ones ... |
I do not remember, what "static" means, but imo only External mode works with Windows ... | |
François 6-Aug-2005 [248] | By static I mean the Web Server takes care to create as many VM instances as needed within the min and max nb of instances allowed by the web master. |
Pekr 6-Aug-2005 [249x2] | that is dynamic, no? |
by what you mean by static does not work with apache on windows anyway ... | |
François 6-Aug-2005 [251] | You are right. So i will try on Apache Linux. It shoud work as I succeeded with both lighttpd and litespeed. By the way, these two web server are very good and so easy to configure (specially LiteSpeed)... |
Luca 19-Aug-2005 [252x4] | I'd like to let my cgi script to be easy portable. I already moved them twice on tree different unix-like OS successfully, but I had always the problem of the first row. If in the first row I wrote #!/usr/local/rebol/rebol -c I need, in the new hosting OS, to have Rebol installed in thet dir. But this is not always true (or simple to set up). So I'd like to use a "portable syntax". Now, I did various tests but I couldn't find a solution. I already tryed: |
1) #!/scripttorebol, where "scripttorebol" is a script containing #!/usr/local/rebol/rebol -c on the first row. But it doesn't work because the rebol code is even interpreted by the OS shell | |
2) #!/bin/bash and in the second row 'exec /usr/local/rebol/rebol -c "$0" "$@" '. Rebol starts correctly but it raise an error because the script does not have a rebol[] header (that is on the following lines) | |
Is there any unix guru who can help me? Thank you | |
older newer | first last |