World: r3wp
[CGI] web server issues
older newer | first last |
Gabriele 12-Dec-2005 [448] | Graham: was that a GET or a POST form? It makes sense for them to record urls with parameters, but it would be disturbing if they where recording POST contents. |
Anton 12-Dec-2005 [449] | Graham, that's very interesting. Good to get an update on how clever searchbots are getting. |
DideC 12-Dec-2005 [450x2] | Good to know !! Looking at some log on a server I have to administrate, Im affraid to see many request trying to find some /ebay, /lassalebank, /admin, /phpmyadmin pages on the site. Internet looks more and more like a jungle. |
Then, no I think of putting "robots.txt" file, I just think that some hackers can use it to exactly do the opposite of what it's suppose to do. They probably have make som bots that just pick all pages marks as 'dissalow in it. If you don't know the name of the pages, it's a good place to find some !! | |
Graham 12-Dec-2005 [452] | Gabriele, it was supposed to be a POST form, but looking now at the source, I see I typed "type=post" instead of "method=post", so it turned out to be GET. |
Volker 6-Jan-2006 [453] | (actually html-question) how do i set the color for <pre>-tags with css? |
Sunanda 6-Jan-2006 [454] | pre {color: blue} |
Volker 6-Jan-2006 [455] | thanks |
Sunanda 6-Jan-2006 [456] | Of, if you meant the background rather than font color: pre {background-color: yellow} |
Volker 6-Jan-2006 [457] | No, hmm, maybe both :) |
Oldes 1-Mar-2006 [458] | what if I have Rebol cgi script in folder /cgi-bin/ and want to write to folder /public/ which is out of the sendbox. How to do it? |
Volker 1-Mar-2006 [459x2] | #!/rebol -s |
#!/rebol -sc of course. the -s swiches sandbox of. i then usually do a secure to my own folder first in the cgi. | |
Thør 4-Apr-2006 [461] | . |
Louis 8-May-2006 [462] | I am running XP on my local computer. Out web host's server is running Red Hat Linux. Which version of core should I use on the host server to run the cgi scripts? If I download the proper Linux core interpreter to my XP computer, and uncompress it using WinZip, will it be corrupted by XP? How do I get a clean version of core to the Linux server? |
Graham 8-May-2006 [463] | ftp |
Louis 8-May-2006 [464x3] | Hi Graham, I am, of course, using ftp. I'm sending core 042 for Red Hat to the server using binary mode. |
The script using text mode. | |
Both files are set to 755. | |
Sunanda 8-May-2006 [467] | <<Which version of core should I use>> Use the most recent Core version that is supported on Red Hat and XP. That way. you'll hit the least code incompatibilites when testing locally |
Louis 8-May-2006 [468x2] | But testing using http returns an error saying that rebol is not in the cgi-bin directory where it in fact is. |
500 Server Error A misconfiguration on the server caused a hiccup. Check the server logs, fix the problem, then try again. URL: http://www.dayspringpublisher.com/cgi-bin/now.cgi /home/daysprin/public_html/cgi-bin/now.cgi: Invalid shebang /dayspringpublisher.com/cgi-bin/rebol: Does not exist! | |
Sunanda 8-May-2006 [470] | Sounds like either: -- your script does not start wityh a shebang -- it does, but the rebol.exe it points to is not there -- you don;t have teh right line endings |
Louis 8-May-2006 [471x2] | #!/dayspringpublisher.com/cgi-bin/rebol -cs REBOL [Title: "Hi"] print "content-type: text/html^/" print [<HTML><BODY>] print ["Hi"] print [</BODY></HTML>] |
Does that shebang look right? | |
Graham 8-May-2006 [473] | no, it is not correct |
Sunanda 8-May-2006 [474x2] | ?? should be be rebol.exe at the end? ?? try an absolute path |
as you don't know for sure where the webserver is starting from | |
Louis 8-May-2006 [476] | exe on Linux? |
Graham 8-May-2006 [477x2] | try #!/home/daysprin/public_html/cgi-bin/rebol -cs |
or check the shebang for any perl scripts you have in your cgi-bin directory to see what it should be. | |
Sunanda 8-May-2006 [479] | okay, forget my fisrt one :-) |
Graham 8-May-2006 [480] | the perl scripts may point to a common perl interpreter so may not help you either. |
Louis 8-May-2006 [481x2] | Graham, that worked! Thanks!. Why did you use daysprin instead of dayspringpublisher.com? |
Thanks also to Sunanada. | |
Graham 8-May-2006 [483x2] | shebangs only refer to the local filing system. They know nothing of web servers which are virtual paths for the web server which is an application. |
And your web server reported the actual path in the 500 server error message. | |
Louis 8-May-2006 [485x3] | It sure did. I didn't notice that. I will have to start paying better attention to what is before my eyes. Thanks again! |
OK, now that cgi is working, I want to make a form that will allow people to give their name and email address to be saved in a rebol db file on the server for me to download at my convenience. Has anyone already done this so that I don't have to reinvent the wheel? | |
Of course, I need the cgi scrpt for this also. | |
Louis 10-May-2006 [488x3] | What is wrong with this script? #!/home/daysprin/public_html/cgi-bin/rebol -cs REBOL [] print "Content-type: text/html^/" html: make string! 2000 emit: func [data] [repend html data] read-cgi: func [ ;Read CGI data. Return data as string or NONE. /local data buffer ][ switch 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 ] ] "GET" [data: system/options/cgi/query-string] ] data probe data ] cgi-data: decode-cgi read-cgi print cgi-data write/append %nr.txt reform [ now/date system/options/cgi/remote-addr mold cgi-data newline ] |
It writes the date and remote-add to the file, but does not write cgi-data to the file. What is wrong? | |
No, I was wrong. It does work. :>) | |
Janeks 11-Aug-2006 [491] | I am trying for first time to setup rebol for cgi on remote Apache web server on Linux. I am working from WinXP Site management is done with EnsimPro. Ftp does not yet working. So what is done up to now: Uploaded file Rebol from rebol-core-2602042.tar package for Linux to cgi-bin directory; Set permisions to owner read, write, execute and for group and others to read, execute; Test script -> write file read file, Test script uploaded (throught web broeser by using EnsimPro web interface) test script: #!/var/www/cgi-bin/rebol -cs REBOL [Title: "CGI Basics"] print ["Content-type: text/html" newline] print "Hello!!!" to cgi-bin directory; Set the same permisions. Pointing to the test file I am getting "500 Internal server errror" What else could be wrong? Interesting that I have interpreters directory on this web server where are couple files regarding php and perl. Could it be connected with my problem? |
Pekr 11-Aug-2006 [492x2] | hi, just playing with cgi too .... your cgi-bin directory seems ok having 755 rights .... |
when I upload my script, I don't feed it with full path, just !#rebol -cs, if the interpreter is from the same directory .... | |
Janeks 11-Aug-2006 [494] | It does not help! |
Pekr 11-Aug-2006 [495] | what is your precise mask for script itself? Try giving it 777 for a while, to see, if it is permission problem or not ... try to print newline at the end of the script ... |
Janeks 11-Aug-2006 [496] | Is it o' k that it is just rebol file from linux package and that I extracted it on WinXp then uploaded? What you meant under "mask"? |
Pekr 11-Aug-2006 [497] | btw - always build your resulting string first out: copy "" ... and then everything append out stuff-you-want-to-add .... print out at the end ... it is MUCH faster to print everything at once, then to print incrementally to the client ... |
older newer | first last |