newlisp-apache-win7

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

Previous topic - Next topic

dukester

Can they "play nice" together?  How?  :D



I've got apache up and running. I've conf it to accept .cgi and .lsp scripts



I'm not sure how to write the initial "shebang" line??? I've been using the FQP to the newlisp executable, but no joy yet!!



Any ideas!!  TIA



[follow-up]



I keep getting this apache error:

[Wed Feb 04 15:16:51.241193 2015] [cgi:error] [pid 5544:tid 984] [client ::1:50169] End of script output before headers: index1.cgi



It means that the http headers are not being sent to the server by newlisp. Don't know why not ...



I seem to get less errors with this first line:



#!"C:Program Files (x86)newlispnewlisp.exe"



but no cigars yets!! lol
duke

dukester

#1
UPDATE



I've reached point where Apache is able to find newlisp.exe and fork a process!!



Now I get getting this error:


Quote[Thu Feb 12 08:45:36.121954 2015] [cgi:error] [pid 1356:tid 984] [client 127.0.0.1:50078] End of script output before headers: index.lsp




Here's the test code:



#!c:binnewlispnewlisp.exe
(print "Content-type: text/htmlnn")
(println "<h2>Hello, World!!</h2>")
(exit)


Simple enough!  Should work, but I'm stuck!!  The required HTTP header is not being sent by newlisp!!!



Anybody know why not?
duke

Lutz

#2
should be:



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

dukester

#3
Quote from: "Lutz"should be:



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


Thanks for getting back to me Lutz!!!



Tried that too!!  No Joy!!! Yet it works under *nix boxes.



I've even made sure that the editor I use to write the script defaulted to using *nix line endings! Do you think that using utf8 character encoding in my editor is hosing the script? I've been using jEdit, so maybe I'll try another editor. If you've got _any_ wild ideas about fixing this, please don't hesitate to fire 'em at me! TIA ...
duke

Lutz

#4
I believe somehow the script file extension must be enabled in Apache as an executable CGI file extension. So, either enable .lsp ore better, instead of index.lsp call it index.cgi. That extension many times is already enabled for CGI scripts and of course it must have executable permissions for Apache or for the user grpup under which Apache runs. I imagine things ar similar on Windows.

dukester

#5
Quote from: "Lutz"I believe somehow the script file extension must be enabled in Apache as an executable CGI file extension. So, either enable .lsp ore better, instead of index.lsp call it index.cgi. That extension many times is already enabled for CGI scripts and of course it must have executable permissions for Apache or for the user grpup under which Apache runs. I imagine things ar similar on Windows.


Thanks for the extra tips Lutz!!! It's appreciated!



However, renaming the file with a .cgi extension did not help. Neither did renaming the file from "index" to "test" for example.  Nothing works.



Yet Apache on my win7 box is serving perl .cgi and .pl scripts!!  Even scripts in the obsolete ICI language and a few others give zero problems.



So I'm convinced that there's an issue with the newLISP/Apache interaction on a win32/64 box. Not sure what, but I can confirm that newLISP in HTTP daemon mode works fine on win7.



Too bad there aren't any folks in the community that are running Apache/newLISP on some Windows incarnation!!  Thanks for the input!!
duke

xytroxon

#6
I don't think it is your script's fault dukester!



newLISP Windows versions 10.5.7, 10.5.8, 10.6.0, 10.6.1, and 10.6.2 crash on Apache web server.



Versions 10.5.6, 10.5.5, and earlier work fine!!!



Last year my newlisp scripts on Uniform Server stopped working for no reason. I thought my server was borked and switched back to using Abyss Web Server. On Abyss, you can setup scripting languages and file extensions or use shebang lines for cgi. I couldn't get shebangs to work, so I just configured  newlisp  under Abyss' "Scripting Parameters" screen in its console, and that got my newlisp wiki and my other newlisp page scripts working again.



I had about an hour a week of "free time" to program last year, so couldn't troubleshoot it then. I would download the new versions of newlisp, but didn't have time to install or check them out. Sometime around July 4th I updated newlisp, but didn't run my server afterwards. A week later I power it up and... WTF???  No clue what happened... I thought I had been hacked.



This year I have my normal life back and I've spent the last two months cleaning house on my disk drive and updating software that I hadn't updated since 2012-2013. This week, after seeing your problem, I tried to get a new Uniform Server install going - and it would not play nice with newlisp! (Of course I had just erased a bunch of my "useless" Uniform Server files last month telling how to set the damn thing up correctly.)



Today I came across my cache of old newlisp windows installers and had an idea. I started installing and uninstalling those old versions while trying to load newlisp wiki under each version.



Bingo, I got newlisp wiki to work on the older newlisp verisons!!!



------------------------------------------------------

------------------------------------------------------

Software used for test:



Uniform Server: 11.7.1 ZeroXI

Apache 2.4.12 VC10 OpenSSL/1.0.1j-fips

http://www.uniformserver.com/">//http://www.uniformserver.com/



Abyss Web Server: X1 -(version 2.9.3.6

non-Apache

http://www.aprelium.com/">//http://www.aprelium.com/



Opera Browser



FireFox Browser



------------------------------------------------------

------------------------------------------------------

Errors occurring:



------------------------------------------------------

Browser web page error for: http://localhost/wiki">http://localhost/wiki

------------------------------------------------------



Internal Server Error



The server encountered an internal error or misconfiguration and was unable to complete your request.



Please contact the server administrator at admin@localhost to inform them of the time this error occurred, and the actions you performed just before this error.



More information about this error may be available in the server error log.



------------------------------------------------------

Win 7 Message Box: newlisp.exe

------------------------------------------------------



newlisp.exe has stopped working



Windows can check online for a solution to the problem.



> Check online for a solution and close the program.

> Close the programn.



View problem details.

---------

Problem signature:

  Problem Event Name:   APPCRASH

  Application Name:   newlisp.exe

  Application Version:   0.0.0.0

  Application Timestamp:   5303758e

  Fault Module Name:   newlisp.exe

  Fault Module Version:   0.0.0.0

  Fault Module Timestamp:   5303758e

  Exception Code:   c0000005

  Exception Offset:   0000b60f

  OS Version:   6.1.7600.2.0.0.768.3

  Locale ID:   1033

  Additional Information 1:   0a9e

  Additional Information 2:   0a9e372d3b4a9135b953a7833882e789

  Additional Information 3:   0a9e

  Additional Information 4:   0a9e372d3b4a9135b9533a78882e789



------------------------------------------------------



-- xytroxon
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

Lutz

#7
Unfortunately, I have no Apache-on-Windows setup to test. Perhaps you can repeat your test with a minimum script, e.g.:



#!/usr/bin/newlisp  
# change above to Windows path

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

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


looking into the change log between 10.5.6 to 10.5.7, I cannot find anything suspicious.



If it still crashes, we at least know, it has nothing to do with some newLISP built-in function not working anymore, but must be some other reason.



If it does not crash, one would have to look at the specifics of the scripts, cutting them smaller until the error disappears.

dukester

#8
@xytroxon



Thanks a bunch for going the extra mile with such a great (but disappointing) reply!



I didn't know why, but I had a hunch that there was something haywire somewhere. I might just have to revert back to an older version of newLISP like you.  Thanks again for the confirmation!!
duke

Lutz

#9
We posted at the same time. Perhaps when trying different versions, you can try the above in my last post.

dukester

#10
@Lutz



I'll give it a shot - but my original test script was pretty simple also! :)  I'll get back to the list ...
duke

xytroxon

#11
These shebang forms all fail:



#!C:Program Files (x86)newlispnewlisp.exe



#!"C:Program Files (x86)newlispnewlisp.exe"



#!"C:/Program Files (x86)/newlisp/newlisp.exe"



http://localhost/test.lsp">http://localhost/test.lsp



#!C:Program Files (x86)newlispnewlisp.exe

(print
"Content-type: text/htmlnn"
"<html>n"
"<head>n"
"  <title>newLISP test</title>"
"</head>n"
"<body>n"
"  <H1>Hello World</h1>n"
"</body>n"
"</html>n"
)
(exit)




This python code works fine: http://localhost/test.py">http://localhost/test.py



#!C:Python27python.exe

print "Content-type: text/htmlnn"
print "<html>n"
print "<head>n"
print "  <title>newLISP test</title>"
print "</head>n"
print "<body>n"
print "  <H1>Hello World</h1>n"
print "</body>n"
print "</html>n"


.htacess file

#------------------------------------------------------------------------------
# Server root folder www .htaccess
# This file provides server security limiting access to the localhost only.
# Comment next four lines to deactivate. (Allows external access)
#------------------------------------------------------------------------------

Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1

#------------------------------------------------------------------------------
# To allow execution of cgi scripts in this directory uncomment next two lines.
#------------------------------------------------------------------------------

AddHandler cgi-script .pl .cgi .lsp .py
Options +ExecCGI +FollowSymLinks

#------------------------------------------------------------------------------
# Activate this section to use the Private Server Feature!
# Defaults: Username - root; Password - root
# Note AuthUserFile: File path is relative to server root
# To lock server, uncomment the next 4 lines. (A name and password is required)
#------------------------------------------------------------------------------

#AuthName "Uniform Server - Server Access"
#AuthType Basic
#AuthUserFile ../../htpasswd/www/.htpasswd
#Require valid-user


-- xytroxon
\"Many computers can print only capital letters, so we shall not use lowercase letters.\"

-- Let\'s Talk Lisp (c) 1976

dukester

#12
@xytroxon

@lutz



I get the very same results -- shebangs do not work!!  I even re-installed newLISP in c:newlisp in order to eliminate the space BS in "Program Files (x86)  ....."  etc etc



Zero Joy!!!
duke

dukester

#13
@lutz

Have you had a chance to look into this issue any further?  Can I be of some help in that regard?
duke

Lutz

#14
unfortunately, I don't have a Windows installation with Apache server available .



I wonder if anybody else runs Apache on Windows and could check this out?