Page 1 of 1

running a nL on nearlyfreespeech

Posted: Tue Aug 25, 2020 10:06 am
by joejoe
I am using

Code: Select all

#/usr/local/env/bin newlisp
(println "hihi")
(exit)
saved as an index.cgi w 755 chmod.

w only a 500 error on nearlyfreespeech.

When I type whereis newlisp, it shows:

Code: Select all

$ whereis newlisp
newlisp:
I have done this before easily.

Now get:

Code: Select all

$ newlisp
-bash: newlisp: command not found
Any tip on how to execute an index.cgi nL script w NFS?

Or if an easier place to up and run nL, please direct. Thought NFS was pretty straight.

Thank you!

Re: running a nL on nearlyfreespeech

Posted: Tue Aug 25, 2020 1:34 pm
by rickyboy
Your #! line looks wrong.

Re: running a nL on nearlyfreespeech

Posted: Tue Aug 25, 2020 2:03 pm
by joejoe
No doubt,

I have tried a few -

#/usr/local/env/bin newlisp
!#/usr/local/bin/env newlisp
#!/usr/local/bin/env newlisp
#!/usr/bin/env newlisp
#!/usr/local/bin/newlisp

If whereis doesnt work, how best to find the right path?

Code: Select all

whereis newlisp
newlisp:

Re: running a nL on nearlyfreespeech

Posted: Tue Aug 25, 2020 2:22 pm
by joejoe
Think they may have lost support?

$ newlisp
-bash: newlisp: command not found

Just submitted a request w NFS to know if it is still supported.

Found that as its been dropped from the bs d port, so no go, only compile from source.

https://members.nearlyfreespeech.net/fo ... ht=newlisp
Newlisp has been dropped from the FreeeBSD ports collection due to lack of support from the developer, so we are unable to offer it preinstalled.

We contacted the developer about this to see if we could facilitate a solution, but we were not successful. The developer recommends that anyone who wants to use newlisp compile it from source.

Re: running a nL on nearlyfreespeech

Posted: Tue Aug 25, 2020 2:32 pm
by joejoe
Any known hosts out of box nL friendly?

Thanks and for all!

Re: running a nL on nearlyfreespeech

Posted: Tue Aug 25, 2020 3:04 pm
by Lutz
When NearlyFreeSpeech.NET Support contacted me, we had a longer email exchange. This is the solution I offered:

Code: Select all

lutz mueller <lutz.email@gmail.com>
	
Apr 17, 2020, 1:05 PM
	
to [NearlyFreeSpeech.NET
Hi Jeff,

You can find a current executable compiled and tested on your server here: http://www.newlisp.org/cgi-bin/newlisp

[newlisp /home/public/cgi-bin]$ ./newlisp
newLISP v.10.7.5 64-bit on BSD IPv4/6 UTF-8 libffi, options: newlisp -h

>

Best regards - Lutz
There where relying on newlisp to be compiled by the FreeBSD organization web site. But FreeBSD organization did not have updated to v10.7.5.

My own scripts on NearlyFreeSpeech.NET all use:

#!/home/public/cgi-bin/newlisp

in the .cgi files. You could just download:

http://www.newlisp.org/cgi-bin/newlisp

and do the same.

Re: running a nL on nearlyfreespeech

Posted: Wed Aug 26, 2020 4:22 am
by joejoe
Thank you Lutz!

I ran these and got pretty much there if it helps anyone. Will figure the rest.

Code: Select all

mkdir cgi-bin
cd cgi-bin
wget http://www.newlisp.org/cgi-bin/newlisp
chmod 755 newlisp

./newlisp
Shared object "libreadline.so.7" not found, required by "newlisp"

wget ftp://ftp.gnu.org/gnu/readline/readline-8.0.tar.gz
tar zxvf readline-8.0.tar.gz
cd readline-8.0
./configure
make

make install
install: /usr/local/include/readline/readline.h: Read-only file system
*** Error code 71
Thanks for allow so much support for all distros and hosting options!

Re: running a nL on nearlyfreespeech

Posted: Wed Aug 26, 2020 3:38 pm
by Lutz
newLISP can be compiled without readline support by taking out: -DREADLINE from the compile line in the make file and take out: -lreadline and: -lncurses from the linkline in the make file.

Here is a new recompile without readline support:

http://www.newlisp.org/cgi-bin/newlisp

compiled using: makefile_bsdLP64_utf8 and shouldn't complain about any library missing.

In case this still doesn't work, expand newlisp-10.7.5.tgz and recompile yourself on your server using:

make -f makefile_bsdLP64_utf8

Re: running a nL on nearlyfreespeech

Posted: Thu Aug 27, 2020 4:18 am
by joejoe
Thank you Lutz!

I replaced the old with the new binary

http://www.newlisp.org/cgi-bin/newlisp

I also am using your

Code: Select all

#!/home/public/cgi-bin/newlisp
Everything worked immediately, and will keep note of your recompile without readline in mind too!

Much appreciated, Lutz!

Re: running a nL on nearlyfreespeech

Posted: Sun Sep 13, 2020 10:41 pm
by joejoe
On this same setup, I am trying to load the cgi module on NFS.net

As directed, I put nL into the /home/public/cgi-bin/newlisp

All works fine. Now to call the cgi module,

I created /home/public/modules and

Code: Select all

wget http://www.newlisp.org/code/modules/cgi.lsp.src.html
mv cgi.lsp.src.html cgi.lsp
I altered the cgi.lsp so the line in cgi.lsp with

Code: Select all

(load "/usr/share/newlisp/cgi.lsp")
is changed to

Code: Select all

(load "/home/public/modules/cgi.lsp")
I am using the simple html form from:

https://en.wikibooks.org/wiki/Introduct ... _HTML_Form

Code: Select all

#!/home/public/cgi-bin/newlisp

(load "./modules/cgi.lsp")

(print "Content-Type: text/html\r\n\r\n")


(set 'search-string (CGI:get "userinput"))
(println (format [text]
        <form name="form" class="dialog" method="GET">
             <fieldset>
                 <input type="text" value="search" name="userinput" >
                 <input type="submit" style="display:none"/>
             </fieldset>
        </form>[/text]))

(unless (nil? search-string)
    (println " I couldn't be bothered to search for \"" search-string "\""))


(exit)
I am getting this error:

Code: Select all

ERR: invalid function in function set : (CGI:get "userinput")
I tried altering

Code: Select all

(load "./modules/cgi.lsp")
to

Code: Select all

(module "./modules/cgi.lsp")
and get this:

Code: Select all

ERR: problem accessing file : "/usr/local/share/newlisp/modules/./modules/cgi.lsp"
called from user function (module "./modules/cgi.lsp")
I think this is where I am missing the correct command:

Code: Select all

(load (append (env "NEWLISPDIR") "/modules/mysql.lsp"))
And I understand creating a .init.lsp in the home directory will create NEWLISPDIR.

as I understand from the Manual. I tried various versions, but haven't found the magic.

Do I need to get NEWLISPDIR at the top of my script somehow? I tried finding an example init.lsp but haven't yet.

I know it is a specific environment issue, so forgive me for asking in that case.

I know I am close! :9)

Thanks very much!