httpd fails on win2k

Started by Jesse Bell, August 24, 2004, 03:51:17 PM

Previous topic - Next topic

Jesse Bell

Newbee ?,

I've installed newlisp recently with the intent of web programming.

Newlisp and Newlisptk work just fine.

However when httpd -p 80 is used,

newlisp.exe just flashes on and off.



Jesse

[/code]

Lutz

#1
Welcome to the group Jesse,



are you running the newlisp program httpd, a webserver written in newLISP? Then you would do:



newlisp httpd 80 someDir



where someDir is the directory where your html files are.



Or are you running newlisp in -p mode, ie.:



newlisp -p 80



in this case you would connect with telnet to it. What is it exactly your are trying to do? There is no: httpd -p 80



Lutz

Jesse Bell

#2
Thanks for the welcome.



c:newlispidenewlisp.exe httpd.lsp 80 ide

or

(load "c:/newlisp/ide/httpd.lsp" 80 ide)



The console will not stay open.



It was my understanding that the console was to stay open in the listening mode.  Allowing a browser to connect and load a page.

Primary objective is to create applications that will use the browser for the GUI.  I hired a programmer a couple of years back to write a small app for me.  He used VB.  Changes are needed now and VB does not interest me.

The sorting takes almost 3 minutes on my amd 1.2ghz.  Lisp seems to me to be the best tool for the job.  The interface is the most time consuming part of the application, and the sort routine is the most complex.  So I am looking at sqlite and lisp to accomplish the task.

I would like to use a browser interface due to the ease in design, and lisp for the sort routine which is what lisp was designed for.  Working on lists.

The Tcl/Tk app is nice, but a browser interface would be supported with fewer files and more compatibility.  It's not like I think this is going to happen tomorrow, but who knows maybe the next day:)



Jesse

Lutz

#3
If you have installed newLISP in c:newlisp do the following:



move httpd into the c:newlisp directory, so you have the following situation:



c:newlisp

c:newlispnewlisp.exe

c:newlisphttpd

c:newlispide



I suppose in newlispide you have the newlisp-ide-3.0.tgz installation installed.



Now go into c:newlisp and do:



newlisp httpd 80 ide



You have to be in WinXP command windows to do this. Typing this in the Start/run box will not work.



Note that you also need a directory c:tmp. If you dont have it, create it. Make also sure you use the latest version of everything newlisp v.8.1.4 and newlisp-ide-3.0.tgz.



Lutz

Jesse Bell

#4
Thanks,

I should have done it that way at first.

The problem was that i was running all from ide.

Thus the 'ide was not setting.

It is serving pages now, however if there is a cgi error httpd exits.

Now I am trying to resolve the path error from cgi.



Are there any other lisp files needed besides the sqlite.cgi?



Once again many thanks for the help.



Jesse

Jesse Bell

#5
Seems that there is a path problem.

in *.cgi path #!/newlisp/ide

Where else would this error be looking from or to?





c:newlisp>c:newlispnewlisp.exe httpd.lsp 80 ide
Server started listening on port: 80
Root directory: ide
Wed Aug 25 15:27:13 2004 127.0.0.1 GET /index.html HTTP/1.1
Wed Aug 25 15:27:13 2004 127.0.0.1 GET /file-frame.cgi HTTP/1.1
The system cannot find the path specified.

list or string expected in function replace : HTTPD:buffer
called from user defined function execute-file
called from user defined function process-GET-request
called from user defined function process-http-request
called from user defined function net-server-accept
called from user defined function startServer

-----

(define (HTTPD:html-error HTTPD:error-no HTTPD:error-txt)
  #(set 'HTTPD:header "HTTP/1.0 200 OKrnContent-type: text/htmlrnrn")#
  (set 'HTTPD:message (append "<HTML><H1>newLISP v." (string (nth
      -2
      (sys-info))) " HTTPD 3.7<BR>" "Error: "
    (string HTTPD:error-no) " " HTTPD:error-txt "<BR></H1></HTML>"))
  (set 'HTTPD:buffer (append HTTPD:header HTTPD:message))
  (net-send HTTPD:connection HTTPD:buffer))

HPW

#6
>Note that you also need a directory c:tmp



Have you done this?



If I remember correctly I had similar error because I did not.
Hans-Peter

Jesse Bell

#7
Thanks for that reminder.

Lutz mentioned that c:tmp.

But I had a c:temp and did not catch it.

That did the trick

Lutz

#8
>>Are there any other lisp files needed besides the sqlite.cgi?



Yes, there is also 'sqlite.lsp' , which does the interfacing with the SQlite database. sqlite.cgi is just a very simple web example application. When you look into sqlite.cgi you see that it loads sqlite.lsp and another file called 'cgi.lsp'.



cgi.lsp contains subrotuines you are going to need for any cgi/web program your are writing with newLISP. Typically the first statment in any of you cgi programs will be: (load "cgi.lsp").



Both applications: ide and sqlite.cgi are good examples how to use cgi.lsp.



All these files are not shipped with the Windows ditribution, but you can get them by downloading newlisp-8.1.4-modex.tgz or by downloading the full source distribution newlisp-8.1.5.tgz, whic h also contains these files.



Lutz

Jesse Bell

#9
Thank you.



Time to start having fun.





Jesse

HPW

#10
>But I had a c:temp and did not catch it.



Same for me ;-)



Maybe it should be changed to check first for a enviroment-var 'tmp' and 'temp' and use this on success.

Just a thought.
Hans-Peter