newlisp-apache-win7

Started by dukester, February 04, 2015, 12:08:58 PM

Previous topic - Next topic

rickyboy

#15
I too don't have Windoze, but this sounds more like an Apache question than a newLISP question.



You might want to try other web servers that do CGI, to narrow down the issue as Apache-related or not.  Maybe try the Nginx stack here: https://bitnami.com/stacks/infrastructure">https://bitnami.com/stacks/infrastructure



Good luck.
(λx. x x) (λx. x x)

rrq

#16
I also don't have it set up to test myself, but is it possible that the script exits too fast, so the output gets discarded before delivery? Maybe a sleep before exit would help? Or perhaps just closing stdout?

rickyboy

#17
Also, have you remembered to do things in the httpd.conf, like add "AllowOverride Options" and "AllowOverride FileInfo", so that your .htaccess directives have any effect?  Do you have access to httpd.conf to change this, if not?



https://httpd.apache.org/docs/2.2/howto/htaccess.html#cgi">https://httpd.apache.org/docs/2.2/howto ... s.html#cgi">https://httpd.apache.org/docs/2.2/howto/htaccess.html#cgi



https://httpd.apache.org/docs/2.2/howto/cgi.html">https://httpd.apache.org/docs/2.2/howto/cgi.html
(λx. x x) (λx. x x)

dukester

#18
Like I indicated up the thread, CGI scripts run with zero problems using other language interpreters!!



So there is NO http.conf issue as far as I can determine.



I have a compiled C script that runs extra quick. I haven't yet seen problems with quick scripts - but I might have missed a lot. :)



xytroxon has had the very same issue (again, look up-thread) - but NOT with older versions of newLISP!!



For me, newLISP would be more attractive in an Apache/CGI context, than in anything else. I'm sure that it could compete admirably if it could be made to play nice - consistently.



So Lutz - what do you need to know to get a better handle on this problem? How can I help?
duke

Lutz

#19
OK, let's start by verifying that the problem starts with 10.5.7 and that 10.5.6 is still fine.



From this directory: http://newlisp.org/dukester/">http://newlisp.org/dukester/



Take env-cgi.txt and rename to env.cgi and change to the correct #! line for your Windows/Apache installation. Then try both of the newlisp executables renamed to newlisp.exe. Make sure that all files have executable permissions for Apache.



If we can repeat xytroxon's observation, I will start rolling back changes in 10.5.7 to the point where it works and we hopefully know what is going on and can try a fixed 10.6.3 executable.

dukester

#20
Here you go my friend ....



#!D:Downloadsnewlisp10507newlisp10507.exe

(print "Content-Type: text/htmlrnrn")



(print "<html>")

(print "<h4>CGI by newLISP v" (sys-info -2)" on " ostype "</h4>")

(dolist (e (env)) (println (e 0) " : " (e 1) "</br>"))

(println "</html>")

(exit)





[Wed Mar 04 18:48:52.963460 2015] [cgi:error] [pid 1176:tid 712] [client ::1:50059] End of script output before headers: env.cgi







#!D:Downloadsnewlisp10506newlisp10506.exe

(print "Content-Type: text/htmlrnrn")



(print "<html>")

(print "<h4>CGI by newLISP v" (sys-info -2)" on " ostype "</h4>")

(dolist (e (env)) (println (e 0) " : " (e 1) "</br>"))

(println "</html>")

(exit)





CGI by newLISP v10506 on Win32

HTTP_HOST : localhost

HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

HTTP_ACCEPT_LANGUAGE : en-US,en;q=0.5

HTTP_ACCEPT_ENCODING : gzip, deflate

HTTP_DNT : 1

HTTP_CONNECTION : keep-alive

HTTP_PRAGMA : no-cache

HTTP_CACHE_CONTROL : no-cache

PATH : C:Smalltalk;C:Program Files (x86)Iconbin;C:ProgramDataOracleJavajavapath;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesCommon FilesMicrosoft SharedWindows Live;C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;c:ansicon;C:Uniconbin;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)GtkSharp2.12bin;C:Program Filesnodejs;C:Program Files (x86)PDFtkbin;C:Program Files (x86)GNUClaws Mailpub;C:Program Files (x86)Windows LiveShared;C:Program FilesMicrosoft Windows Performance Toolkit;C:agenabin;C:bin;C:Gobin;

SystemRoot : C:Windows

COMSPEC : C:Windowssystem32cmd.exe

PATHEXT : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.tcl;.groovy;.gy;.ICX

WINDIR : C:Windows

SERVER_SIGNATURE :

SERVER_SOFTWARE : Apache/2.4.12 (Win64)

SERVER_NAME : localhost

SERVER_ADDR : ::1

SERVER_PORT : 80

REMOTE_ADDR : ::1

DOCUMENT_ROOT : C:/Apache24/htdocs

REQUEST_SCHEME : http

CONTEXT_PREFIX : /cgi-bin/

CONTEXT_DOCUMENT_ROOT : c:/Apache24/cgi-bin/

SERVER_ADMIN : admin@example.com

SCRIPT_FILENAME : C:/Apache24/cgi-bin/nLISP/env.cgi

REMOTE_PORT : 50063

GATEWAY_INTERFACE : CGI/1.1

SERVER_PROTOCOL : HTTP/1.1

REQUEST_METHOD : GET

QUERY_STRING :

REQUEST_URI : /cgi-bin/nLISP/env.cgi

SCRIPT_NAME : /cgi-bin/nLISP/env.cgi

NEWLISPDIR : newlisp
duke

Lutz

#21
Thanks Duke, having the 10.5.6 to 10.5.7 good to bad transition confirmed is a good starting point.



Here: http://newlisp.nfshost.com/dukester/">http://newlisp.nfshost.com/dukester/ are 4 more versions newlisp10507a-d rolling back changes. More to come if necessary. The bulk of changes from 10.5.6 to 10.5.7 is from eliminating strncat() for security reasons and replacing it with memcpy() and these changes could affect processing when Apache feeds the script to newlisp.exe.

dukester

#22
No worries!!!  My pleasure ...



Got the other "sub" versions DLed - will get back to you when I'm done testing. Got to have breakfast first!!  lol
duke

dukester

#23
Versions a & b bombed out!!!



BUT - c & d worked great!!



This is rendered by newLISP v10507d

CGI by newLISP v10507 on Win32

HTTP_HOST : localhost

HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

HTTP_ACCEPT_LANGUAGE : en-US,en;q=0.5

HTTP_ACCEPT_ENCODING : gzip, deflate

HTTP_DNT : 1

HTTP_CONNECTION : keep-alive

HTTP_PRAGMA : no-cache

HTTP_CACHE_CONTROL : no-cache

PATH : C:Smalltalk;C:Program Files (x86)Iconbin;C:ProgramDataOracleJavajavapath;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesCommon FilesMicrosoft SharedWindows Live;C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;c:ansicon;C:Uniconbin;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)GtkSharp2.12bin;C:Program Filesnodejs;C:Program Files (x86)PDFtkbin;C:Program Files (x86)GNUClaws Mailpub;C:Program Files (x86)Windows LiveShared;C:Program FilesMicrosoft Windows Performance Toolkit;C:agenabin;C:bin;C:Gobin;

SystemRoot : C:Windows

COMSPEC : C:Windowssystem32cmd.exe

PATHEXT : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.tcl;.groovy;.gy;.ICX

WINDIR : C:Windows

SERVER_SIGNATURE :

SERVER_SOFTWARE : Apache/2.4.12 (Win64)

SERVER_NAME : localhost

SERVER_ADDR : ::1

SERVER_PORT : 80

REMOTE_ADDR : ::1

DOCUMENT_ROOT : C:/Apache24/htdocs

REQUEST_SCHEME : http

CONTEXT_PREFIX : /cgi-bin/

CONTEXT_DOCUMENT_ROOT : c:/Apache24/cgi-bin/

SERVER_ADMIN : admin@example.com

SCRIPT_FILENAME : C:/Apache24/cgi-bin/nLISP/env.cgi

REMOTE_PORT : 50608

GATEWAY_INTERFACE : CGI/1.1

SERVER_PROTOCOL : HTTP/1.1

REQUEST_METHOD : GET

QUERY_STRING :

REQUEST_URI : /cgi-bin/nLISP/env.cgi

SCRIPT_NAME : /cgi-bin/nLISP/env.cgi

NEWLISPDIR : newlisp



****************************************



This is rendered by newLISP v10507c

CGI by newLISP v10507 on Win32

HTTP_HOST : localhost

HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

HTTP_ACCEPT_LANGUAGE : en-US,en;q=0.5

HTTP_ACCEPT_ENCODING : gzip, deflate

HTTP_DNT : 1

HTTP_CONNECTION : keep-alive

HTTP_PRAGMA : no-cache

HTTP_CACHE_CONTROL : no-cache

PATH : C:Smalltalk;C:Program Files (x86)Iconbin;C:ProgramDataOracleJavajavapath;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesCommon FilesMicrosoft SharedWindows Live;C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;c:ansicon;C:Uniconbin;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)GtkSharp2.12bin;C:Program Filesnodejs;C:Program Files (x86)PDFtkbin;C:Program Files (x86)GNUClaws Mailpub;C:Program Files (x86)Windows LiveShared;C:Program FilesMicrosoft Windows Performance Toolkit;C:agenabin;C:bin;C:Gobin;

SystemRoot : C:Windows

COMSPEC : C:Windowssystem32cmd.exe

PATHEXT : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.tcl;.groovy;.gy;.ICX

WINDIR : C:Windows

SERVER_SIGNATURE :

SERVER_SOFTWARE : Apache/2.4.12 (Win64)

SERVER_NAME : localhost

SERVER_ADDR : ::1

SERVER_PORT : 80

REMOTE_ADDR : ::1

DOCUMENT_ROOT : C:/Apache24/htdocs

REQUEST_SCHEME : http

CONTEXT_PREFIX : /cgi-bin/

CONTEXT_DOCUMENT_ROOT : c:/Apache24/cgi-bin/

SERVER_ADMIN : admin@example.com

SCRIPT_FILENAME : C:/Apache24/cgi-bin/nLISP/env.cgi

REMOTE_PORT : 50611

GATEWAY_INTERFACE : CGI/1.1

SERVER_PROTOCOL : HTTP/1.1

REQUEST_METHOD : GET

QUERY_STRING :

REQUEST_URI : /cgi-bin/nLISP/env.cgi

SCRIPT_NAME : /cgi-bin/nLISP/env.cgi

NEWLISPDIR : newlisp
duke

Lutz

#24
Great news, looks like the bug is fixed. newlisp10507c-ab.exe and newlisp10603.exe should both work:



http://newlisp.nfshost.com/dukester/newlisp10507c-ab.exe">http://newlisp.nfshost.com/dukester/new ... 07c-ab.exe">http://newlisp.nfshost.com/dukester/newlisp10507c-ab.exe

http://newlisp.nfshost.com/dukester/newlisp10603.exe">http://newlisp.nfshost.com/dukester/newlisp10603.exe



Ps: this was posted 1/2 hour ago with wrong files and I removed this post, so download files again.

dukester

#25
I'll check it out, and get back to you!!!
duke

dukester

#26
WOOHOO!!!



This is rendered by newLISP v10507c-ab

CGI by newLISP v10507 on Win32

HTTP_HOST : localhost

HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

HTTP_ACCEPT_LANGUAGE : en-US,en;q=0.5

HTTP_ACCEPT_ENCODING : gzip, deflate

HTTP_DNT : 1

HTTP_CONNECTION : keep-alive

HTTP_PRAGMA : no-cache

HTTP_CACHE_CONTROL : no-cache

PATH : C:Smalltalk;C:Program Files (x86)Iconbin;C:ProgramDataOracleJavajavapath;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesCommon FilesMicrosoft SharedWindows Live;C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;c:ansicon;C:Uniconbin;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)GtkSharp2.12bin;C:Program Filesnodejs;C:Program Files (x86)PDFtkbin;C:Program Files (x86)GNUClaws Mailpub;C:Program Files (x86)Windows LiveShared;C:Program FilesMicrosoft Windows Performance Toolkit;C:agenabin;C:bin;C:Gobin;

SystemRoot : C:Windows

COMSPEC : C:Windowssystem32cmd.exe

PATHEXT : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.tcl;.groovy;.gy;.ICX

WINDIR : C:Windows

SERVER_SIGNATURE :

SERVER_SOFTWARE : Apache/2.4.12 (Win64)

SERVER_NAME : localhost

SERVER_ADDR : ::1

SERVER_PORT : 80

REMOTE_ADDR : ::1

DOCUMENT_ROOT : C:/Apache24/htdocs

REQUEST_SCHEME : http

CONTEXT_PREFIX : /cgi-bin/

CONTEXT_DOCUMENT_ROOT : c:/Apache24/cgi-bin/

SERVER_ADMIN : admin@example.com

SCRIPT_FILENAME : C:/Apache24/cgi-bin/nLISP/env.cgi

REMOTE_PORT : 50679

GATEWAY_INTERFACE : CGI/1.1

SERVER_PROTOCOL : HTTP/1.1

REQUEST_METHOD : GET

QUERY_STRING :

REQUEST_URI : /cgi-bin/nLISP/env.cgi

SCRIPT_NAME : /cgi-bin/nLISP/env.cgi

NEWLISPDIR : newlisp



**************************************



This is rendered by newLISP v10603

CGI by newLISP v10603 on Win32

HTTP_HOST : localhost

HTTP_USER_AGENT : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

HTTP_ACCEPT : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

HTTP_ACCEPT_LANGUAGE : en-US,en;q=0.5

HTTP_ACCEPT_ENCODING : gzip, deflate

HTTP_DNT : 1

HTTP_CONNECTION : keep-alive

HTTP_PRAGMA : no-cache

HTTP_CACHE_CONTROL : no-cache

PATH : C:Smalltalk;C:Program Files (x86)Iconbin;C:ProgramDataOracleJavajavapath;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesCommon FilesMicrosoft SharedWindows Live;C:Program Files (x86)Common FilesMicrosoft SharedWindows Live;c:ansicon;C:Uniconbin;C:WindowsSystem32WindowsPowerShellv1.0;C:Program Files (x86)GtkSharp2.12bin;C:Program Filesnodejs;C:Program Files (x86)PDFtkbin;C:Program Files (x86)GNUClaws Mailpub;C:Program Files (x86)Windows LiveShared;C:Program FilesMicrosoft Windows Performance Toolkit;C:agenabin;C:bin;C:Gobin;

SystemRoot : C:Windows

COMSPEC : C:Windowssystem32cmd.exe

PATHEXT : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.tcl;.groovy;.gy;.ICX

WINDIR : C:Windows

SERVER_SIGNATURE :

SERVER_SOFTWARE : Apache/2.4.12 (Win64)

SERVER_NAME : localhost

SERVER_ADDR : ::1

SERVER_PORT : 80

REMOTE_ADDR : ::1

DOCUMENT_ROOT : C:/Apache24/htdocs

REQUEST_SCHEME : http

CONTEXT_PREFIX : /cgi-bin/

CONTEXT_DOCUMENT_ROOT : c:/Apache24/cgi-bin/

SERVER_ADMIN : admin@example.com

SCRIPT_FILENAME : C:/Apache24/cgi-bin/nLISP/env.cgi

REMOTE_PORT : 50682

GATEWAY_INTERFACE : CGI/1.1

SERVER_PROTOCOL : HTTP/1.1

REQUEST_METHOD : GET

QUERY_STRING :

REQUEST_URI : /cgi-bin/nLISP/env.cgi

SCRIPT_NAME : /cgi-bin/nLISP/env.cgi

NEWLISPDIR : newlisp





Thanks a bunch for going through all that trouble!!
duke