httpd

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

Previous topic - Next topic

eddier

I can get httpd.lsp to run cgi programs on Linux but not on Win32.

I can get httpd.lsp to show html files but that's all.  What am I doing wrong?



Eddie

Ryon

#1
I might be having a related problem. The httpd documentation for Windows says "In the file 'httpd' line 140/41 should be changed." though it doesn't say to what. Line 140 is:  "rnrn")) and line 141 is a blank line. I don't see any nearby code that might need changing.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

eddier

#2
Emacs has the line



(define (log-request request)



Don't see anything to change here.



The only code I can see a change to is line 127 that starts with a comment.



I changed this to Linux line for the Linux box because it was defaulted to Win32.

Lutz

#3
its the line 159/160:





(set 'procStr (append "./" fileName " > /tmp/pcgi" ))    ;; for LINUX

(set 'procStr (append "newlisp ./" fileName " > /tmp/pcgi" )) ;; for Win32





One of the lines should be commented out. The line numbers in the header have not been updated as they should. I will change that today on the file posted on ther site.



Lutz

eddier

#4
Lutz,



httpd will show html pages in netscape but not in IE and won't run cgi programs in either. Can you help me?



Eddie

Lutz

#5
I assume you are running Windows?



make sure that newlisp.exe is in the path of your environment. When you use the files supplied in newlisp-IDE-1.6.tgz, unzip it (works with Winzip) , you can go into the public_html it generates and type:





newlisp httpd 80 .







Lutz

eddier

#6
Thanks!



Will try.



Eddie

Lutz

#7
in Windows/XP (what I am running) it works on:



IE 6.0         (Mandelbrot sometimes doesn't work)

OPERA 6.0

MOZILLA 6.1



The cgi for the read-rocess.lsp example works, if you change "ls -l" to "dir" . The mandelbrot.lsp example works sometimes not on IE but alwyas on OPERA and MOZILLA.



I still have issues handling (save and evaluate in the IDe) files over a certain size, which is the reason I am now handling the POST method from editor-fram.html as enctype="multipart/form-data". Perhaps somebody with more HTML knowledge knows how to get this part working for all type sizes and browsers. This seems  *not* to be an issue with the newLISP httpd, as I have the same issues running newlisp-IDE-1.6.tgz at my ISP with APACHE httpd and on BSD.



Lutz

eddier

#8
I've finally got it working on Windows!



I made a directory called "tmp" under the directory "test" that I was using as the root directory in the httpd call



newlisp httpd 80 /test



No avail!



Then I changed where output from the program is redirected from  "/tmp/pcgi" to the file "pcgi" in the current directory. Works fine! for some reasong it can't find the directory "tmp?"



Eddie

Lutz

#9
'/tmp' should be 'c:tmp' on a Windows machine. newLISP will take '/' as the root directory of the current drive. On windows normally 'c:tmp' does not exists, sometimes there is a 'c:temp'.



Lutz

Ryon

#10
I should have noticed the semicolons in the listing, Lutz. Sorry. Fortunately, the default is set correctly for Windows users like me.



But the problem remains: I get an "Error: 400 Cannot handle request" in the left frame when trying to use the IDE. The server itself is functional, it will serve the html in the editor frame, but there seems to be something wrong with the cgi in the file frame. I've set the Path environment variable in the control panel, and tried substituting the full path for the "." in the command line, but no luck. On my machine, the command is:



newlisp httpd 8080 newlispidepublic_html



and I've created a tmp directory in public_html and in system root, "just in case".
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

Lutz

#11
in your case it seems to get stuck in '(process-http-request request)' . In the beginning of the httpd programs do:



(define debug-flag true)



Then you can observe what kind of request httpd receives. The error message you are receiving indicates, that for some reason it receives an invalid request type, not GET, POST or HEAD





Lutz

Ryon

#12
The client requests three GETs:



GET / HTTP/1.1

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

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



I confirmed this with a (print buff) in net-server-accept. The problem seems to be html-error 400 in execute-file rather than in process-http-request. I think I've tried all possible variations of c:\temp\pcgi but nothing seems to get written to disk, and buffer always comes up nil.
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

eddier

#13
I had a similar problem on the win2000 machine in the business office.



In



(define (execute-file fileName data)



Try changing



(set 'procStr (append "newlisp ." fileName "> /tmp/pcgi"))



to



(set 'procStr (append "newlisp " fileName " > pcgi"))



and change



(set 'buffer (read-file "/tmp/pcgi"))



to



(set 'buffer (read-file "pcgi"))



Eddie

eddier

#14
I made a mistake.



change



(set 'procStr (append "newlisp ./" fileName " > /tmp/pcgi"))



to



(set 'procStr (append "newlisp " fileName " > pcgi"))



kill the "./" and the "/tmp/"



Eddie