Page 2 of 2

Re: Newlisp-Apache-CGI Issues Again

Posted: Sat Mar 30, 2019 1:12 am
by ralph.ronnquist
Hey!
dukester wrote:
Response header name 'Environment variable TMP not set, assuming /tmp .Content-Type' contains invalid characters, aborting request
That error message shows that newlisp has an initial "complaint" about "TMP", which means what it says, and that complaint precedes the script output. It has nothing to do with your script.

So the quest should rather be to get rid of that piece of output. That amounts to making sure that TMP is set before newlisp is invoked, or, you get it compiled without that complaint.

Re: Newlisp-Apache-CGI Issues Again

Posted: Sat Mar 30, 2019 1:23 am
by dukester
I've got TMP/tmp/temp set in so many places that all hell wont have it. BTW I never get this bleeding tmp issue with any other script.

Re: Newlisp-Apache-CGI Issues Again

Posted: Sat Mar 30, 2019 1:42 am
by ralph.ronnquist
RIght. And yet it's missing for newlisp.

Apparently Apache has "SetEnv" and "PassEnv" directives that possibly would service your use case. Or else, I suppose you can wrap the script with a shell script for this purpose. Or if you like living on the edge, you could apply a binary editor to your newlisp executable and put a \000 at the beginning of the boring output string ;)

Re: Newlisp-Apache-CGI Issues Again

Posted: Sat Mar 30, 2019 2:50 am
by rickyboy
Good catch, Ralph. I read that message wrong (but yet there is the response header name, right there between the two single quotes). Didn’t help that duke’s OP didn’t have the entire message there to begin with. Kinda faked me out. dukester! lol ;)

Re: Newlisp-Apache-CGI Issues Again

Posted: Wed Apr 03, 2019 10:42 pm
by dukester
Problem solved!

I configured Apache to run as a reverse proxy on a sub-directory to my cgi-bin containing newlisp scripts. I run newlisp as -http -d 8080 -w <full\path\to\cgi-bin\newLISP>

In Apache httpd.conf, simply load:
mod_proxy.so
mod_proxy_http.so
mod_proxy_http2.so

and insert the following directive in the same file:

Code: Select all

<Location "/cgi-bin/newLISP/">
      ProxyPass  "http://127.0.0.1:8080/"
</Location>
Cigars and joy all around!!! :-)