REBOL3 - CGI (web server issues [web-public])

Return to Index Page
Most recent messages (300 max) are listed first.

819amacleodwrong group...sorry10-Jun-09 2:58
818amacleodI'll have a static ip by next week so I hope that solves this issue for me..10-Jun-09 2:49
817Maximahhh yes, I can use the cgi headers to see if they are set... that was obvious... seems, I'm still not fully recuperated from the virus which I've been "nurturing" for a few days now.9-Jun-09 20:39
816Grahamsystem/options/cgi9-Jun-09 20:28
815MaximI want to print out an html error when run from cgi, but execute code when run stand-alone.9-Jun-09 20:13
814Maximis there a ways to know if a rebol script is being run as cgi or as a stand-alone?9-Jun-09 20:12
813PekrNVU is old Mozilla attempt to separate page editor into something like FrontPage. I think it is not developed anymore, but some ppl do continue with developments under the name Kompozer. More info here - 1:57
812ChrisNVU?8-Apr-09 23:08
811AntonYeah, definitely check that. If it's rebol, then it can be easily fixed.8-Apr-09 16:03
810Pekrsome old Mozilla web building SW, don't remember its name. It was some three letters name. But - maybe one of my friends is doing some small Rebol client app edits (putting news into the main site), so maybe it is his script which does so. I need to check with him, it is an encapped app, so I can't see the sources ...8-Apr-09 15:49
809AntonWhat is the tool your client uses which produces the extra lines? It is the source of the problem.8-Apr-09 15:39
808Pekrno, I can try once I get at home ... that might be more secure solution, thanks ...8-Apr-09 15:39
807AntonDid you try 664 first ?8-Apr-09 15:38
806PekrChanged index.html permission to 646, and it works now. Maybe CGI scripts are being run under the Apache user or group, who knows. Thanks for pointers!8-Apr-09 15:30
805Pekrhmm, maybe I found the problem - it has rw--r--r-- file permissions ....8-Apr-09 15:22
804Pekrno, it is a different directory .... the script is being run in /cgi-bin/, while index.htm is at the root of the web ...8-Apr-09 15:21
803AntonMaybe the cgi script current directory is not where the index.htm file is. See if you can list the file, eg. instead of write/lines %index.htm data do this: print mold info? %index.htm8-Apr-09 15:19
802Pekrpermissions look OK, but I will recheck. Dunno what user Apache runs cgi scripts under, so I better check it is others writeable ....8-Apr-09 12:28
801PekrI am sure, as I get cgi script output to the browser window. It just fails on the last line - write/lines %index.htm data8-Apr-09 12:27
800AntonCheck the permissions of the file to be written. Are you also sure the cgi script is being executed? Check its permissions too..8-Apr-09 12:16
799PekrMaybe I should try the trick to connect to the FTP account and upload it there, instead of rewriting? :-)8-Apr-09 10:41
798PekrOne of my clients updates his site via some tool, which always seem to add some space between the lines. After some time, the page is instead of 400 rows something like 13K rows - the size goes from cca 25KB to 100KB. So I wrote a cgi script, which reads index.html and removes blank lines. Everything is OK, when I run the script from the console. But when I run it via a browser as a CGI script call, it can't write the file. Dunno why - cgi-script is being run using -cs switch, I even put secure none in there, cgi-script has the same own, grp set as index.html, but I can't write it ....8-Apr-09 10:40
797SunandaYou want to set the file permissions for each script globally executable, but not globally readable. Also protect the cgi-bin folder from being read by the whole world...If you are using Apache, look at the IndexIgnore directive: 17:47
796eFishAntWhat are the best ways to protect source code from view in a cgi script? When a script is made world-viewable, isn't that compromising the source pretty badly?9-Mar-09 17:21
795MaartenNo, before the webserver, so you scale transparantly to multiple webservers (in my scenario each webserver effectively is the load balancer for X FastCGI rebol processes; it's how nginx and lighty work)25-Nov-07 18:43
794Pekror some special server part?25-Nov-07 18:07
793PekrI don't understand it a bit. I can understand webserver, fastcgi, mysql part, but what is that load-balancer part? Client side?25-Nov-07 18:07
792RobertSounds very cool. Go for it!!25-Nov-07 17:30
791MaartenAs a rebol process is only 10 Mb.... I can serve lots of users on cheap VPS's, load balance them, data backup in S3. No others invited until I get things stable enough. eed to ge things going25-Nov-07 16:32
790MaartenI am using from SVN and trac, the actual application I am building is for personal life management.25-Nov-07 16:30
789MaartenFastCGI is a rebol process with core enhancements, session mgt, RSP etc. I am also integrating autodoc from Gabriele so the files will be more "literate" and I have a module management system in place thathandles from interactive to encap.25-Nov-07 16:29
788MaartenBut yes: load-balancer -> webserver(*) -> FastCGI(*) -> MySQL25-Nov-07 16:28
787MaartenThat's how I should have described it in one sentence.25-Nov-07 16:26
786RobertMaarten, this sounds very cool. So the goal is to have a scalable web-service framwork based on fastCGI and simple tools?25-Nov-07 15:04
785MaartenI finally learned the trick: 1) create a good interface (but w eknew that) 2) use back-end technology that lowers the cost per user (i.e. enlarges the # users per box)24-Nov-07 22:57
784Maartenearn = ask24-Nov-07 22:54
783MaartenWith the avereage memory use fo Rebol < 10Mb you can coompute how many users I can concurrently server for complex operations (100-200 minimum), so every machine I hire can host 500 customers. That means that I should earn e0.50 customer to get a decent margin (roughly).24-Nov-07 22:54
782MaartenSession management is database-backed, so scaling up is hiring VPS'es and putting pound in between24-Nov-07 22:51
781MaartenThe generating part will be asking you a few questions and the generate matchhing config files and binaries that you can copy to an empty Linux box with only lighttpd installed (or enginx)24-Nov-07 22:51
780MaartenI am also adding a routing scheme (dialect) so basically you redirect all traffic except static stuff to a fastcgi process, it comes in the router and then it checks on extension or path (REST) what to do.24-Nov-07 22:50
779MaartenI am close to autogenerating fastcgi processes, linked with Lighttpd configs and generating automagical includes that match the web server config for encap/Pro.24-Nov-07 22:49
778WillWith Cheyenne you can already have the main httpd process on one machine and task-handlers (RSP or whatever) on other machines 8)11-Nov-07 18:14
777RobertAs dispatching requests is most likely much faster than processing a request, a single web-server should serve a lot of users and a bunch of machines do the processing.

This is the coarse grained multi-process approach.

11-Nov-07 9:40
776RobertMaarten, I agree with your observation and you can even scale it more.

If you see a web-server as just a request dispatcher to CGIs and a fast-answering-machine for user-feedback (pages, forms etc.) you just need a small and "simple" one like Cheyenne. The CGIs can be distributed to different cores (through the OS) or even to different machines (via TCP/IP).

11-Nov-07 9:39
775MaartenRead that, but that is why the adaptive scaling with lighttpd is interesting if you put number of request/fcgi porcess on 1. Then the daemon scales for you10-Nov-07 14:19
774PekrThat REBOL doc should really answer your question. Simply put, in External mode, you do something like /path/to/script (that does not need to exist) and you direct it to certain, already running REBOL process. But - rebol has no tasking, so you have to handle accepting connections and multiplexing. It is like with Rubgy - unless you are finished, you are not available to other requests ...10-Nov-07 13:57
773PekrHope you read 13:51
772PekrI don't think those 10 processes would listen on port 1026? In fact I don't know, how it is being done.10-Nov-07 13:47
771PekrAlso, there was problem, that the same client could be served by different process, so fastcgi guys implemented some kind of "afinity patch", kind of proxy, which then connected the same client always to the same process.10-Nov-07 13:46
770PekrI used fastcgi in the past, wich Apache, under linux. All modes worked fine IIRC. However, under windows, the implementation was crippled, and only external mode worked.10-Nov-07 13:45
769MaartenCan anybody give me an exampkle setup + explanation of FastCGI + lighttpd with FastCGI; also on the Rebol side. I know Francois mentioned it was easy but I don't get how you can do adaptive spawning one the same listening port (e.g, 10 Rebol FastCGI processes listening on port 1026 or so)10-Nov-07 13:16
768Gabrielepetr, the processes are managed by the OS too. *obviously* the os will distribute processes among processors. (unless the os has no multiprocessor support, that is). distributing threads is more difficult (because of the shared memory), however all good threading implementations should do it, and if you programs the threads correctly you can get the performance boost.23-Oct-07 21:04
767GreggThreads are much lighter, but not as separate. I don't know details though. On a dual core with hyper-threading on, spawning multiple processes, I can see the load is spread.23-Oct-07 17:19
766PekrGregg: really? I thought that the reason why R3 will use threads for tasking instead of tasks is, that OS can better balance threads? Anyway, those questions are for gurus, I can only wonder :-)23-Oct-07 17:17
765GreggIf they are separate processes, the OS should balance over cores.23-Oct-07 17:00
764PekrAre you sure OS distributes CGI processes to different Cores? Is e.g. Apache working that way?22-Oct-07 18:40
763Maartendepends on what you gain22-Oct-07 18:32
762Pekrnot virtualising OS this days is imo a mistake, no? :-)22-Oct-07 18:27
761MaartenWinding down: Apache CGI with RSP is pretty good these days. If you combine: - module management - logging - error handling - session management - database protocol (mysql://) - CGI params handling

you can "just work".

22-Oct-07 17:42
760MaartenNow, what happens? The OS will start distributing the CGI processes over the multiple cores. Using the disk cache etc to speed loading times, enough memory per core on the processor. A 8Gb RAM quadcore should be able to run +- 1000 procs/sec (rough estimate). That's just one box, with that load it should be profitable. And as you obey rule 6, you can scale up and load balance pretty easily.22-Oct-07 17:40
759Maarten1) Think multicore 2) think memory is cheap (2Gb per core) 3) Typically, /Core consumes 8 mb of memory 4) do not encap, use amodule management system like my 'require or Ladislav's 'include 5) wrt 3 and 4: the OS starts using its disk cache etc. After a few hits these operations will be cheap 6) do all session mgt etc in a database => sales up as well, no state, share nothing22-Oct-07 17:37
758MaartenFirst - do not virtualize OSes22-Oct-07 17:34
757MaartenLet me explian.... (the PITL in user.r reminded me to post this)....22-Oct-07 17:34
756MaartenAnybody noticed CGI is back as a programming model?22-Oct-07 17:33
755RobertSIs that the tune that sounds like "God Save The King?"' If there's a sugar maple blight, 'The Maple Leaf Forever' will sound lame ... and they'll never see the Eastern Townships annexed by Vermont. 'CGI' does stand for 'Chat Gateway Interfarce' doesn't it ?20-Sep-07 0:34
754btiffinDon't forget the great big smiley...19-Sep-07 15:11
753Terry"We fly the flag of peace and truth".. hummed to the tune of "God bless America"19-Sep-07 7:37
752btiffinMy uplink speed kinda (no, it pretty much completely) sucks but I offer free hosting to any rebol that wants it at I just ask for patience if a new service needs to be installed while I work out kinks and the user needs to know that it's home based with a not-so-speedy delivery pipe and I offer little in the way of frills; meaning it's sftp or ssh cli, not cPanel or other gui.18-Sep-07 19:57
751btiffinPetr; DON'T :) Suggesting that people try and sneak REBOL past sysadmins is a really really really bad idea. If they can't be convinced to try it, then change ISP, or try to convinvce them again. Don't be making REBOL look all cracky. That is the kind of maneuver that could sink the ship. The rest of us like the ship, and we fly the flag of peace and truth, not the Jolly Roger. :)18-Sep-07 19:38
750Gabrieleyes, it will be downloadable unless you deny it with htaccess, but that's usually not a big problem.18-Sep-07 17:15
749Pekrbut maybe it could be prevented to be seen by setting some .httaccess option ...18-Sep-07 17:14
748Pekrbut then it will be probably downloadable :-) 17:14
747Gabrieleexactly.18-Sep-07 17:10
746Pekraha, ok ... so, if I put REBOL into other dir, even if it has execute bit in order to be runnable, Apache will not run it, as directive for the directory does not allow that, right?18-Sep-07 17:10
745Gabrieleeg. in apache you have ScriptAlias directive to tell it where to allow executables.18-Sep-07 17:09
744Gabrieleit's not execute bit of the dir, and it has not much to do with unix permissions, it's web server config. normally, web server will only execute things from cgi-bin and not somewhere else.18-Sep-07 17:09
743PekrOK, I feel I miss knowledge on Unix permissions. So if cgi-bin dir as a whole has execute bit, everything in there can be executed? Hmm, and don't I need execute bit for rebol itself, even if put into other directory?18-Sep-07 17:07
742amacleodAt least that was the explanation I was given...\18-Sep-07 17:07
741Gabrielewww root - well, you can put in www but outside cgi-bin, so it can be downloaded but not executed. or, worst case, hopefully they allow you to put a .htaccess to deny access to rebol itself.18-Sep-07 17:06
740PekrThat is why I was trying to suggest to rename rebol to some AAAAAAABBBBBBBCCCC name, unpredictable, so it will get hardly noticed, even if someone would try ... (unless you do some bug and your shabang line gets reported back to browser :-)18-Sep-07 17:06
739amacleodI have a rebol view app that I use to acces a MySQL database. I had it working and then ,y ISP decided to add security and no longer allow MySQL access unless its a script on the server. Ofcourse they did not inform me and it took some time to track down the problem..18-Sep-07 17:05
738Gabrielemysql: some hosts only allow socket access and not tcp access to mysql (because that's the default config for some distros.) but, that's something that they can enable without problems.18-Sep-07 17:05
737PekrGabriele - exactly my opinion ....18-Sep-07 17:05
736PekrBut other hosting my friend has, is just and only his www root ....18-Sep-07 17:04
735Gabrieleyes, /home, maybe /home/bin or something like that. (/home/rebol/... would be ok too)18-Sep-07 17:04
734Gabrieleindeed, i think they are just lazy, and want rebol to work out of the box. they just have to upload it. it will work with 99% of the hosts right away. and the host should be able to easily solve that 1% case, unless they are morons and only allow php etc. by policy.18-Sep-07 17:03
733PekrWith one host, I e.g. have: /home, /www, /tmp, /logs ... should I put into /home?18-Sep-07 17:03
732Pekramacleod. And how?18-Sep-07 17:02
731amacleodWhat I have found to be a problem is accessing MySQL accounts from client based rebol scripts. They seem to only allow server based access.18-Sep-07 17:02
730Pekrah, so I really don't understand guys' point on ML, complaining that web-hosts are REBOL unfriendly. I tried with two, and those had no problem uploading rebol for me ...18-Sep-07 17:02
729amacleodaccess for rebol18-Sep-07 17:01
728amacleodAny ISP that gives you FTP access to your account and CGI does provide18-Sep-07 17:01
727Gabrieleafaik, any host that allows any cgi-bin will also allow you to upload rebol somewhere not in cgi-bin and then use it.18-Sep-07 17:01
726PekrI don't need it on my server, was trying to help other guys to not feel pressed from ISPs18-Sep-07 17:00
725Pekrbecause ppl endlessly complain, there are no rebol web-hosts. So I thought I might have universal solutoin. Just find yourself web-host, which allows cgi scripts, and you are done ...18-Sep-07 17:00
724Gabrielemaybe, but is it really worth it? i don't think anyone would put perl in cgi-bin for eg. so why rebol?18-Sep-07 16:59
723Pekrhmm, woult there be an option to prepare special version of interpreter, using SDK, not allowing to accept any parameters, run only in CGI mode?18-Sep-07 16:58
722Gabriele(it shouldn't be that easy, but you get the idea)18-Sep-07 16:58
721Pekrhmm, then ice thing is, that when I run --do "print 123", Apache returns error, stating I have no permission to do that. If I run cgi-bin/rebol, my browser does not seem to return, so I expect interpreter to run infinitely?18-Sep-07 16:57
720Gabrieleif it's in cgi-bin, maybe i could do something like http://yoursite/cgi-bin/rebol?-s%20--do%20delete... etc.18-Sep-07 16:57
719Gabrieleyes, /rebol/rebol.exe will not be executed by the web server, unless it is specifically configured to do so.18-Sep-07 16:56
718Gabrielemaking rebol accessible is a security risk. i don't know of anything bad that you can make it do, but i'm sure it would not be too hard to make any interpreter do something bad if you allow it to be launched by anyone :)18-Sep-07 16:56
717PekrSo, in terms of my website, if I put rebol executable e.g. into /rebol/rebol.exe, is it any different security-wise to /cgi-bin/rebol.exe?18-Sep-07 16:56
716PekrI'll check, but with hosting I have I seem to have root set to my web root.18-Sep-07 16:55
715Gabrielewhy? ftp access only gives access to cgi-bin? usually, you have your own home dir, with www and cgi-bin dirs inside.18-Sep-07 16:54
714PekrGabriele - where it is not accessible? That means I need other then FTP access. That ruins easy REBOL deployment ...18-Sep-07 16:52
713Gabrielethe scripts have to be in cgi-bin, the interpreter can (and should) be somewhere else, where it is not accessible.18-Sep-07 16:50
712RebolekPekr, well they don't have to. Script's permissons are different from some random visitor's permissions. Script is local and not remote.18-Sep-07 13:04
711Pekrbut even then, putting it in another dir, in order to be able to run rebol, I have to set it as runnable too, no? So what is the difference in having it in cgi-bin or other directory, if permissions have to be equal?18-Sep-07 12:17
710PekrI mean - let's say I don't have telnet available - just ftp to upload my site ...18-Sep-07 12:16
709Pekraha, but can it be dir of my own site?18-Sep-07 12:16
708Gabrielepetr, it is much better to just put rebol in another dir. there is no reason to have it in /cgi-bin/18-Sep-07 12:04
707ChrisMy understanding is the latter would be slower. Also, QM (as an example) doesn't generally require a get query or post data (primarily uses path info).17-Sep-07 14:50
706PekrOr what about building special rebol version using SDK, running by default in cgi mode, quitting imediatelly, if there is not get or post string?17-Sep-07 13:38
705PekrI just wanted to ask - wasn't there some change in the past, to prevent such case? Would it be sufficient to rename rebol.exe to something like EDB433BDD7C13851C7C68CB31A5ACF33A80CD2CC? :-)17-Sep-07 13:37
704PekrI mentioned the possibility (to overcome REBOL web-hosting) to place rebol executable directly in the /cgi-bin/ directory. Someone on ML mentioned I should not do that, security wise, as calling will spawn a process, which will run endlessly or so ...17-Sep-07 13:36
703james_nakThanks all. In the end I switched hosts and their mx records work so problem solved.6-Sep-07 5:19
702Grahamwhy not try using set-net [ email localhost ]31-Aug-07 8:02
701Gabrieleusually PHP uses the sendmail command directly, not SMTP, so it can't be compared unfortunately (ie the fact tha php can send mails does not guarantee that rebol can). but, you could use CALL and call sendmail directly too if there is no other option.31-Aug-07 7:55
700james_nakOh, Haven't tried that. I'll see.31-Aug-07 5:23
699Grahamwhat is the trace/net say?31-Aug-07 3:02
698james_nakAnyone know the answer to this one? I have a cgi script that sends an email out. The problem is that I want to send to an address that has the same domain name as the website but whose mail server is not located there (It's an Exchange Server). Any other address works fine as expected. I think it has to do with the mx records but, the weird thing is that if I generate an email via php, it goes through. Therefore I'm thinking Rebol can do it too. I've used set-net for the smtp server and have set it a different server completely but still no go. And I'm in the process of having the MX records changed.30-Aug-07 20:48
697DanielSzReceived. Thanks, indeed.26-Jul-07 21:20
696GrahamSent.26-Jul-07 20:54
695DanielSzAnd the good news is: curl does it flawlessly. I just saved myself two weeks of headaches. I am a reboller, but not a purist, if I find a better tool to do something, that's cool with me.26-Jul-07 20:50
694DanielSzGreat, can I see it?26-Jul-07 20:34
693GrahamUndocumented .. but basically it took a directory of jpegs and zip files and uploaded them to a java based webserver that required custom headers26-Jul-07 20:25
692GrahamI found the script .. written in 2002.26-Jul-07 20:24
691DanielSzYeah, I remember some tips you contributed to the rebolzine on posting to web forms, way back... Anyway, I think I won't tinker with the http scheme, kinda dpressing thought, especially since I have great hopes to achieve what I need using curl and the shell capability of Rebol. Let curl do that work, afte r all, that's what' it's meant to do best.26-Jul-07 20:22
690GrahamDaniel, I wrote http-tools.r before there was a read/custom .. that's how old the script is!26-Jul-07 20:13
689DanielSzGraham, I'm a big fan of http-tools.r (I believe you wrote it,right?). I used it in my DYNdns client that I wrote in Rebol. I realized only recently that some of the functionality was built-in.(Basic authenticaion with read/custom). Grrrr... if only you hadn't thrown those upload scripts away :)26-Jul-07 19:49
688DanielSzGraham described what needs to be done (I used a variant of the http-tools.r script, composed the correct header, and then insert the headers, and then switched the port to binary before inserting the payload). Only it's a little a bit above my capacities. In other words, I'll need two weeks to do it, if I ever manage it.26-Jul-07 19:42
687DanielSzThe script should be able to post a multipart form as described in rfc1867. It should be able to post a number of fields, for example: Content-Disposition: form-data; name="userid", and finally it should be able to upload a file in binary data.26-Jul-07 19:35
686Volkerdo you need to write binary, or a multipart?could be multipart can use base64. then its somewhat bigger, but has no problems with text-mode. could even be that multipart of email works the same. in that case there is 'build-attach-body.26-Jul-07 19:07
685DanielSzI played with Oldes script a bit, didn't get far. I think there's no other option than follow Graham's advice and delve in the http scheme. I had hoped to find something in the script archive, oh well... I saw that even in the Ruby and Python community there's some confusion on how to achieve multipart form submissions with CGI. (Python default http library also uses "application/x-www-form-urlencoded" and not ""multipart/form-data", but there's a library called HTTPFileUploader that does the job). Last time I tried to hack the http scheme I wasn't so succesful. This time, if I need help, I'll ask for help.26-Jul-07 16:18
684Volkeri guess i am on the wrong track..26-Jul-07 16:09
683Volkerhmm, does open/custom do that. i hope..26-Jul-07 16:04
682Volkerwhat are you doing? still uploading binary? then use open/insert/close and change port to binary if it is open26-Jul-07 16:03
681DanielSzThanks everybody. I'll keep you posted.26-Jul-07 16:02
680DanielSzOk, I'll try to hack the http-tools.r, see if I can get anything done. I saw a script written in python claiming to do multipart uploads, but I hope I can get it working in Rebol, which for me is always first choice.26-Jul-07 15:46
679GrahamI used a variant of the http-tools.r script, composed the correct header, and then insert the headers, and then switched the port to binary before inserting the payload26-Jul-07 9:49
678GrahamI don't know if it helps, but I did write a web server stress test that did a http upload of hundreds of images in Rebol that year.. but the scripts are long lost.26-Jul-07 9:47
677btiffinThe last ML entry I mentioned has the reference to Olde's script. rmlRDSC If it does the job of tweaking the lines mode? Haven't looked.26-Jul-07 8:55
676DanielSzThanks, Graham, you hit the right spot. Like you say in your article, "Read/Custom sets the port to lines modes, and there is no clean way to change this to binary for binary uploads". But that's exactly what I need. Which script by Oldes are you referring to? Where can I find it? Are you saying that his is doing the job?26-Jul-07 8:33
675Grahamthis is an article I wrote in 2003 hacking the http protocol to do this too 1:19
674GrahamOldes' script looks like it should do the job.26-Jul-07 1:15

But to be honest, I've been waiting for Graham or Dockimbel to notice the conversation. My exposure to this sequence is purely "little think cut'n'paste" from the cookbook, since I'm REBOL in, REBOL out for the website I run. :)

26-Jul-07 0:39
672btiffinMy bad. but unfortunately this article skips over the info for multipart/form.26-Jul-07 0:34
671DanielSzIn other words, the rebol script has to send values to a form on the server issuing something like that in the header: Content-Type: multipart/form-data; boundary=----------6l5Xq9lJYPaaypknAH8Des etc. Surely someone has done this before (I hope)...25-Jul-07 23:50
670DanielSzIn that ML thread, the request was to handle a multipart upload on the server side (in rebol). I need to perform a multipart upload on the client side (in rebol). As for the seconde link, unfortunately I get "Article x60 is no longer available ". Any idea?25-Jul-07 23:45
669btiffinTry this ML thread and some notes by Sunanda on CGI 'safety' 22:58
668DanielSzThanks for the help. The recipe from the rebol cookbook show you how to upload a file provided the server runs a rebol script too. The server I'm uploading a file to doesn't. It expects multipart/form-data. Maybe the %cgi.r by Cal Dixon provides a solution. I'll investigate further. More hints will be appreciated, as well...25-Jul-07 22:45
667btiffinDaniel; Try for some code. And for a REBOL sample solution and then wait for the rest of the forum members to pipe up with 'bigger better' solutions, and they will. :)25-Jul-07 22:23
666DanielSzHello, I need to send multipart/form-data to a server for uploading a file from the console. I've been googling and searching the script archive, to no avail. Can anyone help?25-Jul-07 22:11
665btiffinAnd thanks to %blog.r's abuse? code, I should be able to stop most of the potential harm...but I'm still reiterating this to the client.19-Apr-07 21:41
664btiffinI'll reinform them of the potential problems of having this type of form on their page.19-Apr-07 21:38
663btiffinThe form comes with a note about far anyway. I'm showing off the

print "location: " umm, redirect, to them right now as we speak.

19-Apr-07 21:34
662btiffinI'm popping up an Alert... This is a client request, I'm looking at options. Thanks for the hints.19-Apr-07 21:33
661Gabrieleif you need to rely on JS, you could do an xmlhttp request...19-Apr-07 21:31
660Gabrielewhy should not the user leave the form? should a user be able to send it multiple times?19-Apr-07 21:31
659SunandaYou could try sending back a 204 response. Means "no content" in the response. No idea what a webserver would do with that. A 205 might work too.19-Apr-07 21:28
658btiffinHi, question for the webheads.

In short. Can a form call a cgi action that processes data but doesn't output any Content-type (or anything for that matter) without the browser status coming up with "waiting for reply".

I've got a client that wants a form for requesting more info, but they want to leave the user on the same screen, so I thought I could have a %process.cgi that takes the data and plays with it and then have an intrinsic onsubmit=alert(...) to inform the user that the request has been submitted.

The %process.cgi doesn't print "Content-type ..."

it doesn't print anything, as I was hoping to leave the same browser screen up.

Am I living in lalaland?

Should the %process.cgi just redirect back to the original page with?

print "location: /original.html^/content-type: text/html^/" or is that deprecated now? It works under my test heads, Cheyenne and nonIE browser, but is there a bigger better way? Or do I tell the client that the browser needs a new page and I can add a back link (not preferred).

Thanks for listening

19-Apr-07 21:20
657Maximthanks this will get me going :-)26-Feb-07 17:43
656Oldesgoogle "javascript cookies tutorial" and use rebol to call javascript to get the cookies26-Feb-07 17:42
655Maximis it possible to extract/change a cookie from the site a plugin is working in?

I have embedded an app within an IIS served web site. I must make the reblet interact with the site's cookie, so it follows the rest of the site's status when relaunched (browsing to/from the app from other pages restarts the rebol app).

26-Feb-07 17:14
654Gabrieleyes; and if you use SuExec the process owner becomes the script owner (i.e. your user id), but SuExec is tricky business.24-Feb-07 9:28
653ChrisThe process owner depends on the httpd config, right?23-Feb-07 17:11
652Chris(see 'Files' group)23-Feb-07 16:57
651ChrisI built this into my Sandbox port...23-Feb-07 16:56
650ChrisAlso, I don't know if this is so with every setup, but when you create a file with a CGI script, the process owner, not the script owner, is the owner of the file, so you'd need to be able to do owner-read/owner-write. I usually set owner/group/world-read/write to true and execute to false.23-Feb-07 16:55
649ChrisYou shouldn't need to open a file port to set-modes, just set-modes %file.r [... modes ...]23-Feb-07 16:52
648Gabrielewhat's the easiest thing to do is.... delete those files from the script :)23-Feb-07 8:46
647Gabrieleyou can't change the owner of a file, unless you are root23-Feb-07 8:46
646Grahammore likely you're in the wrong directory.23-Feb-07 6:29
645JoshI get an access error when I try to set the IDs, so it seems not possible...23-Feb-07 6:13
644JoshCan you set the owner-id / group-id with set-mode? Is there a good resource on set-modes other than the function dictionary? I've been searching but haven't come up with anything...23-Feb-07 6:10
643JoshAnd I am officially tired. It does help to make the script executable.......23-Feb-07 5:52
642Joshchange-dir %blogs/ foreach file read %. [ port: open file set-modes port [ world-read: true world-write: true world-execute: true ] close port ]

But with my tired mind, and the no end of 500 errors, I must be forgetting something.

23-Feb-07 5:47
641JoshI'm trying something to this effect:23-Feb-07 5:47
640Grahamif the script can write the files, presumably you can use the same script to alter the attributes ( set-modes ).23-Feb-07 5:26
639JoshAnd my second question, is this blogger.r the most fully featured version of the orginal blog.r ? I've been out of the loop for a while.23-Feb-07 5:22
638JoshOr is this server / apache config? I have no admin access to this box, so this could cause some annoyances23-Feb-07 5:10
637JoshOk, I have a question regarding blog.r . I set it up on a server to play with it for a few minutes. After a couple kinks, I got it working with a few tests. I went to delete the test blogs but found they were created under the www-data user and group (this is on a linux server) and I do not have writes to delete or modify these files. In the future, is there a way to have the files created under a different user / group?23-Feb-07 5:09
636Alek_KThanks Gabriele!19-Feb-07 12:01
635Gabrieleotherwise, you need to ask Carl (repeatedly ;) for a new freebsd build for you.19-Feb-07 10:11
634Gabrieleit is possible that it can interfere with other apps, so they might refuse to do it. however, linux allows "local" libs (not system wide, but just for your cgi or even just for rebol), so if it's the same on freebsd they could do that.19-Feb-07 10:10
633Gabrieleit don't know freebsd well enough to give you a good answer. however, usually, if is missing but they have (eg or then it is enough to have a ln -s to make rebol work. same for any other missing libraries. this does not work always but works in most cases.19-Feb-07 10:09
632Alek_KGabriele - can You tell me what should I tell to "tech guy"?17-Feb-07 9:46
631Gabriele99% of the times a symlink solves the missing lib problem.16-Feb-07 18:29
630Oldesbut I think, that it's not on the top in the priority list16-Feb-07 18:01
629Alek_K(ok - used feedback form)16-Feb-07 17:58
628OldesTry to use feedback 17:53
627Alek_KShared object "" not found, required by "rebol"

So ISP said "this software is old - please upgrade, as we did". Argh... how can I argue with him? Any suggestions? I'm green in such subjects as freeBSD/unix/linux.

16-Feb-07 17:11
626SunandaAl I know is that the IS neglected to start the "Linux compatability module" on a reboot -- and so 500ed for most of a day until we got t sorted. I've sent Alek the full emails from the ISP documenting the problem, but they don't realy say very much more.15-Feb-07 11:45
625OldesCan you run Rebol from shell?15-Feb-07 9:57
624Alek_KTried it - 500 as before :)15-Feb-07 9:48
623PeterWoodGiven the small download and simple installation, it may be worth a try.15-Feb-07 9:45
622PeterWoodThere is a FreeBSD version of Rebol Core but I'm not sure which version of FreeBSD..15-Feb-07 9:45
621Alek_KThanks for help - I'll try to ask Sunanda15-Feb-07 9:45
620Alek_KAs I remember there was some words (2 years ago) about "argh! we must downgrade libraries just for You" (or similar - it was FreeBSD too)15-Feb-07 9:44
619PeterWood..well more detail than I do.15-Feb-07 9:44 had a similar problem when the ISP moved from Linux to BSD - they fixed it by running a linux compatibiity utility. Sunanda knows the details.15-Feb-07 9:43
617Alek_KThis (in readme) makes me think: "Requires specific library versions on Linux/Unix systems"15-Feb-07 9:41
616Alek_KFor 2 years :)15-Feb-07 9:40
615Alek_KYes - before I jast had in root directory a catalog with permissions and all worked.15-Feb-07 9:40
614PeterWoodDid you install Rebol yourself?15-Feb-07 9:39
613Alek_KMy ISP just changed OS for FreeBSD 6.2 - and all my rebol cgi scripts are not working! What should I ask them to?15-Feb-07 9:37
612james_nakThank you all. I will try it.22-Jan-07 21:54
611SunandaJames: try this: 21:45
610Maximjames, I am sure this has been discussed before and pekr and/or sunanada gave such an example... try doing a search or reading about it here in earlier conversations...22-Jan-07 19:17
609Henrikjames, let me know if you come up with something. I was doing some session stuff for blogger.r, but stopped due to lack of time.22-Jan-07 19:12
608james_nakDoes anyone have a nice "easy to use" sessions code like php so I can "secure" pages like the rebol blogger editing?22-Jan-07 18:48
607Henriksystem/options/cgi/remote-addr is not registered, apparently, so I can't edit pages.5-Dec-06 12:26
606Henrikhas anyone made Carls blog script work with webserv.r? I get very odd behavior here.5-Dec-06 12:24
605OldesTry to use Feedback - - I don't think there is many people using Rebol with IIS25-Oct-06 20:35
604JaneksHow the MS IIS is putting those cgi data into system/ports/input? I had problem with MS IIS - hangs on read-io - results to cgi timeout!24-Oct-06 8:24
603Gabrieleafaik, the latest is "secure enough" (esp. if you configure it properly). it's not the best system out there, and being very popular it is also a popular target, but if you don't have time to replace it but can keep it up to date you should be fine.28-Sep-06 10:09
602yeksoonif you have PHP on the can try SwiftMailer. 2:20
601AshleyI'm using to handle some simple contact details collection, but seems it is not highly regarded in the Perl community due to it's vulnerability to SPAM and bots. nms seems to offer a more secure version, , but I haven't done anything with Perl for years now. Anyone have a suggestion for a good replacement, are are rumors of it's death greatly exaggerated?27-Sep-06 23:10
600james_nakYes, that may be a concern as well. I'm running on a virtual server so I could change those parameters. Maybe I should investigate some type of Rebol client app. instead. Basically, what I'm after is a what for my students to send in their homework files that is better and smarter than this dropbox solution that they have now. It doesn't give them feedback of a successful upload and I end up with files upon files of slightly uncategorized uploads.26-Sep-06 15:59
599OldesYes, more input-file fields is possible as well, just you may reach the upload size limit more easily. Most servers I used has maximum 2MB per post, so if you want to upload 5 images with 1MB, you will not be able to post them at once.26-Sep-06 6:33
598james_nakI checked it out and it basically has a button to add more inputs to the page. There was a snippet available on the web that does this. That definitely is a possiblity.25-Sep-06 17:49
597james_nakHmmm, I'll look into that as well. Thanks.25-Sep-06 17:06
596Gabrieleyou can probably handle multiple files using javascript too. (qtask does it, but i never used it so i don't know how it's done.)25-Sep-06 17:05
595james_nakOK, that should be good.25-Sep-06 15:48
594Oldesmaybe I can make some example in the future25-Sep-06 15:48
593Oldesso on the cgi side you get just one file as from one input file field25-Sep-06 15:48
592james_nakOh, OK. I get it. Thanks!25-Sep-06 15:48
591Oldesit just sends data to cgi (one by one = not all at once)25-Sep-06 15:47
590james_nakI mean, does it simply send it to a cgi program or does it save the files sent as well?25-Sep-06 15:46
589Oldeswhat is file saving portion?25-Sep-06 15:46
588Oldeshere is ActionScript doc example: 15:45
587james_nakOK, I'm going to try it. Does the flash also handle the file saving portion?25-Sep-06 15:45
586Oldesif you want to upload more files using flash, it's very simillar to the example above, just you have to use FileReferenceList! instead of FileReference!25-Sep-06 15:44
585james_nakThanks.25-Sep-06 15:43
584james_nakNo, it isn't which is kind of strange. I would use the Rebol plugin but I haven't had too much success and I don't want to create more work supporting users.25-Sep-06 15:42
583Oldesi think, it's not possible in pure html25-Sep-06 15:40
582Oldesthere is only one file upload in the examples - 15:40
581james_nakIs that in your example code?25-Sep-06 15:40
580james_nakOldes, I knew you would say that! : )25-Sep-06 15:39
579OldesI'm doing multiple file uploads using flash825-Sep-06 15:39
578james_nakDoes anyone have any ideas about how to approach a web-based gui that allows users to upload multiple files at one time without having a series of "inputs?" I'd like to have users do a ctrl select when they are browsing for multiple files to send. Thanks.25-Sep-06 15:38
577Grahammy app is less than 1 mb, and the installer is 40mb :)22-Aug-06 20:31
576Henrikwell, it's a no go for me. everything has to be bundled into a single lightweight package. I think it's a little absurd having to blow up the app by a factor of 2-5 in size, just to get pretty thumbnail generation for it. I hope a future version of DRAW will allow better downscaling.22-Aug-06 20:30
575GrahamNo time to figure this all out .. just ask users to install Imagemagick :)22-Aug-06 20:27
574Grahamalthough again, I could not get the ole object to work just by registering it with regsrvr22-Aug-06 20:25
573Grahamor, presumably, include the ole object, and register it when the program installs22-Aug-06 20:25
572Grahamjust include the dlls you need22-Aug-06 20:24
571Grahamsure ...22-Aug-06 20:24
570Henrikit's not easy to bundle with an app, is it?22-Aug-06 20:24
569Grahamjust not for the things I'm doing with it.22-Aug-06 20:24
568Grahamimagemagick is very fast22-Aug-06 20:23
567HenrikI'm missing a compact solution to make high quality thumbs. if only DRAW was up to the task...22-Aug-06 20:21
566Henrikah, so it's not useful for realtime stuff?22-Aug-06 20:20
565GrahamHenrik, at present I am converting PDFs to JPG, and since it uses ghostscript as well, it is not that fast ... but I don't have too long a wait.22-Aug-06 20:18
564GrahamI'm using the com+ server at present stil as I wasn't able to get your script to work. When I have time, I'll try again.22-Aug-06 20:17
563Henrikgraham, and how fast is it?22-Aug-06 20:00
562EdgarSo Graham, is ImageMagick working okay with you in Rebol? Which version did you finally use?22-Aug-06 19:52
561JaneksIt's looks like I first try to negotiate with SP - probably he could help.22-Aug-06 7:54
560JaneksBecause I don't know it. And I whanted to use my blog site as demo for all those good things that could be done with Rebol. But whell - as I undertood I can use it on Linux web server. Anyway thanks, Graham, I will check how can I use them.22-Aug-06 7:43
559Grahamwhy don't you use imagemagick with rebol ?22-Aug-06 7:38
558JaneksSounds like I should to think about other solutions of human control and image resizing & texts on them. It is a pitty. Human control could be organized by just set of image files with some "kidnaping" fonts letters and some simple script in Core. Image resizing (f.ex. when uploading) theoreticaly could be done with Core - but it seems too much work for me now, because I dont know yet how image files is built and those resizing algorithms. And about text placing on uploaded images I can forget. All things above could be done in View just fine. :( It was good idea, that I made first my private blog site on Linux. Despite Rebol runs on so many systems - running the same things on other systems should be checked before. Especialy if there are no expierence of work on that system.

BTW I found in the google the similar response was caused from uncomplete View instalation: But it looks that this is not the case.

22-Aug-06 7:07
557Volkersize-text: xwindows is client/server. the x-server , that is your local computer, which offers to aplications to display things to you. And it has some important informations locally, especially the fonts (and can cache images and such). /view needs access to the fonts and so access to a running x-server. the x-libs are only an interface to connect to the server. (The xserver-libs could be used directly, but well, /view does not do that. Seems to be tricky.) A incomplete sketch how to do it, with no attention to security: So with /view you need a running x-server, one way to do that headless is vnc. Can also run on another machine. Then you need to tell rebol where it is, there is an env-var $DISPLAY. Which must be set before rebol runs. Did not figure out how to configure that. Running a bash-script as cgi, set $DISPLAY, call the real rebol-script should work. And there may be issues with authentification, x-windows does not like everyone to connect by default, or the other way around, its too easy to make it too open ("xhost + ip"). There are more secure ways, but looked more complicated and i never tried. All in all i would run such things on windows.21-Aug-06 17:07
556AntonDo you have a linux box at home to play with ? You could try install Rebol/View on it without X running and see what error you get...21-Aug-06 15:00
555AntonI haven't used rebol much on linux, yet, but the error sounds suspiciously like the common mistake of running rebol without X running, as Tom said. The linux server you are uploading rebview to may very well *not* be running X. If that is the case, you will have to settle with Rebol/Core only. Do you really need View features ? I know some people found that they missed some image manipulation functions from Rebol/View that are not available in Rebol/Core.21-Aug-06 14:58
554Pekrhmm, size-text - it does sound like a native. IMO it is wrapper for OS level function, returning pixel size of particular text .... could that be a problem of some missing os library?21-Aug-06 14:41
553JaneksAnton, do you have any idea about ** Near: size-text self with Linux and rebview for cgi?21-Aug-06 13:51
552JaneksPersonaly I do not like M$ as it is monster. ;-) But in my last and current work I am not responsible on which web server to chose and therefore neither for security of web server. And I am trying to separate my resposibility and SP responsibility, but of course there is cases when they overlaps. I am just trying to find as much as possible info about security of web servers and it does no matter if it is M$ or not . My first installations was on IIS 5.0 in intranet - so I relied on firewall. The last case is in public internet. So I think if there are no possibility to upload danger cgi scripts or pass danger code to existing scripts, than from my side I did all.21-Aug-06 13:49
551AntonI haven't set up Rebol with IIS myself, but my immediate reaction is to ask another question: "How much do you believe Microsoft?" Of course Microsoft will lead those who are a little unsure to believe that alternate software is less secure.21-Aug-06 12:46
550JaneksWell - I found it: And Rebol script works well when in Web Service Extensions you set as Allowed All Unknown CGI extensions. But then you will get warning message, that it could be potential security threat - then the next question is from dummie: Is it safe to install rebol in such way?21-Aug-06 11:49
549JaneksAnother story on Win: Anybody noticed any differences in instalation of Rebol on MS IIS 6.0 and IIS 5.0? It looks like all things is the same but I am getting on my test.r "The page cannot be found", while index shows that test.r is there.21-Aug-06 10:53
548JaneksIt is on Linux!21-Aug-06 7:04
547Tomcand if you do have X installed the cgi script is likely not run from a graphicly aware shell so there may be virtual frame buffers involved21-Aug-06 0:14
546Tomcfirst guess view may not work without X installed (does not on solaris) and there is no good reason to run X on a web server ... and then there are all those fiddley fonts21-Aug-06 0:12
545JaneksI asked for mu web service provider to add to the server he did not aprove that he did (actualy I did not get any answer yet), but today I found that my test script:

#!/var/www/cgi-bin/rebview -cs

REBOL [Title: "CGI Basics"]

print ["Content-type: text/html" newline]

print "Heloooooo!!!"

works differently - I am getting following response:

** Near: size-text self

You can check:

What could it mean?

20-Aug-06 19:12
544Gabrielepetr, load/library is probably a bit different from what ldd does on startup. i suppose ldd wants current dir in the lib path to load libs from current dir (same issue as executing programs from current dir...)17-Aug-06 9:45
543Antonor all these ? -csiw16-Aug-06 16:24
542AntonRyan, are you sure that the -i or --noinstall command-line argument option does not help ?16-Aug-06 16:22
541Pekrwhat about asking server admin to add the library for you? He just could unpack it for you from his distro CD/DVD to the location where it belongs ....16-Aug-06 13:07
540Pekraccording to Gabriele, Linux might have some default library locations ... but e.g. I run sqlite as dll, and I point rebol to load the library and it loads it from anywhere. The question is, if the same is right for executable dependant libraries16-Aug-06 13:06
539JaneksI found that in my case on Linux RebViev needs! I tried to google for "download", but there was a lot of links for different things and it seems form me that it is included in some installation packgage. Could some body help with this library an is it worthwile (will RebView takes it from current dit)?16-Aug-06 13:00
538SunandaI susoect View may be trying to pop-up an installation window......And so that appears on the server's console (if any). meanwhile, you wait at the end of an Internet connection unable to see anything. Possible work-around: manually install whatever files View is trying to configure?16-Aug-06 12:11
537RyanLet me know if anyone figures this out.16-Aug-06 0:38
536RyanWhen I tried it, View seemed to want to try to install itself, and errored out when it tried to show an installation window. Various combinations of command line options were no help. I didnt try using old versions of view, or tricking view into thinking its already installed.16-Aug-06 0:36
535Gabriele(iirc)14-Aug-06 11:55
534Gabrieleconfigured library path (usually /lib/, /usr/lib/, etc), or the value of the env variable LD_LIBRARY_PATH.14-Aug-06 11:55
533Pekr"ldd rebol-view-executable" under Linux could tell you what libraries are needed. If that is not much (e.g. one library being dependant upon other etc.), you could try to upload those libraries to where your view executable resides. The question is, what is Linux OS strategy to look for libraries - current dir, some central libraries storage path, elsewhere ...?13-Aug-06 12:13
532Grahamswitch to a windows host. solves that.13-Aug-06 11:30
531SunandaRunning View as a CGI can be a problem. I don;t know any solutions to that.13-Aug-06 11:20
530Pekrnot sure where/how view looks for such library ...13-Aug-06 8:26
529JaneksI uploaded view but it it does not work - I just see error 500, but i think rview is the reason , because I changed in working script just first line that points to rebol executable. Its a pitty - I wanted to add some funcionality above to my home page. Q: Is it possible to add required libs? F.ex. just in the same dir.12-Aug-06 20:23
528JaneksWhat I want is just do some image conversation and to make some human control (small image with string on some patern background ...)12-Aug-06 15:25
527james_nakJaneks, I suppose it depends on what you want View to do. You can go ahead and put it in your cgi bin but It won't create interactive interfaces as you can when you run it locally. You can try the plugin for that kind of thing.12-Aug-06 0:05
526Pekryou can check by issuing: ldd your-rebol-view.exe11-Aug-06 17:12
525Pekrnot sure what dependencies are there ..... there might be some library missing, as happened with my Command due to AGG11-Aug-06 17:12
524Pekrit all depends, if such machine has X-Windows installed, or not. Mine has not IIRC ....11-Aug-06 17:11
523Pekrnothing, but it might eventually not work ...11-Aug-06 17:11
522JaneksIt even works with .r extension.11-Aug-06 15:43
521JaneksThanks all - as always most obvious things are those on which we make mistakes. All was o' k except I changed rebol to rebcore, because I wanted also work with Rebol view and ... ... forgot it. Too much copy & paste.

Well the next question is - if and what else is needed to install rebol view for cgi operations?

11-Aug-06 15:40
520james_nakBTW, if i makes you feel any better, I tested your script in my host and it works. I'm wondering if the "#!/var/www/cgi-bin/rebol -cs" is not actually pointing to the where it should be. Did the hosting company give you the exact path?11-Aug-06 14:23

Return to Index Page