httpd

Started by eddier, October 07, 2002, 07:52:02 AM

Previous topic - Next topic

Ryon

#15
Thanks Eddie, but it still isn't working.



I understand that this part of the code creates a string, newlisp file-frame.cgi > c:temppcgi (or whatever) to be used along with another string name=data/ as arguments for the next term write-process. The strings are created, but the pcgi file is not. This string of code will create a pcgi file when keyed from the command line, but will not create the file from inside the program.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#16
There shouldn't be a need to tweak the CGI generating statement. I would start over and do exactly what's recommended in the README file of the newlisp-IDE-1.6.tgz package. All problems I have seen, always boiled down to one of the following:





- no c:tmp or /tmp directory present

- wrong permissions (on UNIX OS's)

- newlisp executable not in PATH

- make sure, that 'write-process' or 'exec'  (the same thing) works on your  OS installation;  try (write-process "dir")  or (exec "dir") from the command   line of the newlisp executable (not from the tk-frontend)





The default in line 159/160 done for Win32 does also work on UNIX. If it still doesn't work, enable debugging with "(set 'debug-flag true)" and post the output on the board, so we can look at it.



Lutz

eddier

#17
Ryon:



Are you using Windows 2000 or XP? If so, are you logged in as an Administrator or a User? This may be far fetched as I'm not that good with Windows stuff, but I think that you have to have rights set to write to some directories in those OSs. If you log in as Administrator you should be able to write to the c:tmp directory.



Eddie

Ryon

#18
I'm using Windows 2000, and am logged on as administrator. Something as simple as permissions could prevent the program from working properly, and it's something the Win user usually doesn't consider, thanks.



I'm doing a reinstall, by the numbers. Stay tuned.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Ryon

#19
Lutz, I think your last suggestion exposes the problem:



- make sure, that 'write-process' or 'exec'  (the same thing) works on your  OS installation;  try (write-process "dir")  or (exec "dir") from the command   line of the newlisp executable (not from the tk-frontend)



(write-process "dir") from the command line returns "String expected in function write-process". and (exec "dir") returns "Invalid function".



Your documentation shows that two arguments are required for the write-process function, so this may not be the best test of the function, but this is exactly where I had trouble as shown in my previous posting. There are two strings at that point in the httpd code, and they do produce results if typed in from the command line, but nothing when run in place in the program. The documentation for write-process is very terse, and I don't understand it. Hence my posting.



The DOS box is not cut and paste, so I hope there are no transposition errors in this debug listing:



newlisp httpd 8080 c:newlisppublic_html

Server started listening on port: 8080

Root directory: c:newlisppublic_html

GET / HTTP/1.1

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*

Accept-Language: en-us

Accept_Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Host: localhost:8080

Connection: Keep-Alive



Thu Oct 10 12:08:44 2002 127.0.0.1 GET / HTTP/1.1

GET /file-frame.cgi?name=data/ HTTP/1.1

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*

Referer: http://localhost:8080/">http://localhost:8080/

Accept-Language: en-us

Accept_Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Host: localhost:8080

Connection: Keep-Alive



Thu Oct 10 12:08:44 2002 127.0.0.1 GET /file-frame.cgi?name=data/ HTTP/1.1

newlisp .file-frame.cgi > tmp/pcgi

GET /editor-frame-new.html HTTP/1.1

Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint, */*

Referer: http://localhost:8080/">http://localhost:8080/

Accept-Language: en-us

Accept_Encoding: gzip, deflate

User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Host: localhost:8080

Connection: Keep-Alive



Thu Oct 10 12:08:44 2002 127.0.0.1 GET /editor-frame-new.html HTTP/1.1
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#20
since version 6.5.18 'write-process' and 'read-process'  are collapsed in to 'exec', all three functions point to the same function, which works like the old 'read-process' when given one parameter and which works like 'write-process' when given two parameters.



try everything again using a newer version (the last official newLISP is 6.5.23) and use together with newlisp-IDE-1.6.tgz.



Put 'debug-flag' mode back into nil:



(set 'debug-flag nil)



But change in line 162



(if debug-flag (println proc-str))



to:



(println proc-str " " data)



On my WinXP machine I see the following:



Wed Oct 09 15:33:08 2002 127.0.0.1 GET / HTTP/1.1

Wed Oct 09 15:33:08 2002 127.0.0.1 GET /file-frame.cgi?name=data/ HTTP/1.1

newlisp ./file-frame.cgi > /tmp/pcgi name=data/



The last line is the contents of 'proc-str' and 'data'. What happens here is the following: the program 'newlisp' will be executed taking the file: 'file-frame.cgi' as the program file, the string 'name=data/' is the query string which is used as STDIN from the 'read-line' statement inside the program in file-frame.cgi. The output of the whole process is written to the file '/tmp/pcgi' where it is picked up later and send back by the hhtpd webserver to the remote browser.



Hope this was not to confusing :-)



Lutz

Ryon

#21
We all knew I was doing something wrong, but what? Well, it turns out I had the  6.5.8 version of newLISP installed. I did an "upgrade" recently, and  must have installed this older version instead of the newly-downloaded one. I am embarrassed and sorry for the trouble this has caused!!! The IDE works just fine now.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#22
I am glad you found the problem Ryon.



Lutz