Simple nL Web Page in http mode

Started by joejoe, February 22, 2011, 04:14:17 PM

Previous topic - Next topic

joejoe

Hi -



I am working on my local machine (Linux Mint < Ubuntu < Debian) and trying to get a simple web page to load.



I ran this newLISP command to get the server running:



newlisp -http -d 8080 -w /home/joe/newlisping/web



And inside of the web directory I have a file called go.lsp which is this:


#!/usr/bin/newlisp
#
# First newLISP from-scratch web site :D


(print "Content-Type: text/htmlrnrn")
(println "<h3>My 1st newLISP Web Site! :D</h3>n")

(exit)


When I take Firefox to /home/joe/newlisping/web/go.lsp I see the file contents, not a web page.



I even tried to chmod 755 the file but still only see the file contents.



Any quick pointer would be great! Thanks!!



newLISP v.10.2.8 on Linux IPv4 UTF-8

Lutz

#1
Two things:



1.) Rename go.lsp to go.cgi. newLISP server only recognizes files with the extension .cgi as CGI files, else it will display the contents or html.



2.) Type this into your browser http://localhost:8080/go.cgi">http://localhost:8080/go.cgi

If you just type the file-path of your file newLISP server will not get involved at all, and Firefox will always display only the contents of the file, no matter what extension.

joejoe

#2
Woo-hoo!!! :D



Now I'm cookin w/ newLISP. :0)



Biggest thank you, Lutz.

joejoe

#3
No longer cookin,



newLISP v.10.3.3 on Linux IPv4/6 UTF-8 on Debian Squeeze i686 GNU/Linux.



I launched the newLISP server with this:


newlisp -http -d 8088 -w /home/joe/nl

Inside my /home/joe/nl directory I have this file:


-rwxr-xr-x 1 joe joe     334 May 23 18:15 index.cgi

with this code:


#!/usr/bin/newlisp

(load "Web.lsp")

(print "Content-Type: text/htmlrnrn")
(println "<h3>My 1st newLISP Web Site! :D</h3>n")

(exit)


The /home/joe/nl directory is chmod 755.



Loading the index in my browser w/ this url:



localhost:8088/index.cgi



makes the nL server print out this error:


sh: 1: ./index.cgi: not found

I can verify that the directory is correct because I created a test.txt file and can see that fine.



Did something change from 10.2.8 to 10.3.3 that might affect loading the index.cgi?



Thanks!

Lutz

#4
Does #!/usr/bin/newlisp refer to the correct path in your newLISP installation?

joejoe

#5
QuoteDoes #!/usr/bin/newlisp refer to the correct path in your newLISP installation?


doh!



I changed it to /usr/local/bin/newlisp and corrected my module loading to this:


(module "web.lsp")

and Im cookin again! Thanks very much, Lutz! Wont make that mistake again.