httpd fails on win2k

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
Jesse Bell
Posts: 6
Joined: Tue Aug 24, 2004 8:20 pm
Location: Miami

httpd fails on win2k

Post by 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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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
Posts: 6
Joined: Tue Aug 24, 2004 8:20 pm
Location: Miami

Post by Jesse Bell »

Thanks for the welcome.

c:\newlisp\ide\newlisp.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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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:\newlisp\newlisp.exe
c:\newlisp\httpd
c:\newlisp\ide

I suppose in newlisp\ide 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
Posts: 6
Joined: Tue Aug 24, 2004 8:20 pm
Location: Miami

Post by Jesse Bell »

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
Posts: 6
Joined: Tue Aug 24, 2004 8:20 pm
Location: Miami

path error

Post by Jesse Bell »

Seems that there is a path problem.
in *.cgi path #!/newlisp/ide
Where else would this error be looking from or to?

Code: Select all

c:\newlisp>c:\newlisp\newlisp.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 OK\r\nContent-type: text/html\r\n\r\n")#
  (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
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

>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
Posts: 6
Joined: Tue Aug 24, 2004 8:20 pm
Location: Miami

Post by Jesse Bell »

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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

>>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
Last edited by Lutz on Thu Aug 26, 2004 12:13 pm, edited 1 time in total.

Jesse Bell
Posts: 6
Joined: Tue Aug 24, 2004 8:20 pm
Location: Miami

Post by Jesse Bell »

Thank you.

Time to start having fun.


Jesse

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

>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

Locked