0

Tried to follow guide from previous question Apache + mod_lisp + clisp

CLISP is installed and works sucessfully:

(load "modlisp-clisp") (modlisp:modlisp-server) runs ok ie endlessly

Python works fine out of /usr/lib/cgi-bin via localhost

Tried to make clisp server work out of /var/www/html/lsp

browser access via localhost/lsp prints : mod_lisp 2.0 This is a constant html string sent by mod_lisp 2.0 + CLISP + apache + Linux

BUT localhost/lsp/test.lisp just returns internal server error (chmod 777 test.lisp done)

test.lisp at clisp interpreter comes up no package with name "content-type":

(defun xyz()
    (format t 'Content-Type: text/html;charset=utf-8')
    (print())
    (print())
    (print(coerce '(#\u2211) 'string))
    (print(coerce '(#\U20AC) 'string))
    (format t "hello world!")
)
(xyz)

Details: uname -a Linux me-H97N-WIFI 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

apache2ctl -M AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message Loaded Modules: ... lisp_module (shared) ..

/etc/apache2/sites-enables/000-default.conf:

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all

(MY LISP AMENDMENTS:)

Location /var/www/html/lsp> SetHandler lisp-handler Location>

/etc/apache2/mods-enabled/lisp.conf:

LispServer 127.0.0.1 3000 "/var/www/html/lsp"

Where have I gone wrong? Should lisp server somehow operate out of cgi-bin alongside python? how do i send html headers?

Community
  • 1
  • 1
Fredo
  • 27
  • 3

1 Answers1

0
'

Is not a valid string delimiter. It is the quote operator, which causes the form it marks to be unevaluated, so you can call functions operating on those forms themselves.

Try replacing the single quote with the double quote, which will cause it to be read as a string.

(format t "Content-Type: text/html;charset=utf-8")
Langston
  • 1,083
  • 10
  • 26
  • TX: using clisp in cgi-bin and $ clisp test.lisp as an executable script now produces chinese and euro sign correctly on gnome terminal, but not via localhost: in python this is circumvented by writing directly to sys.stdoput.buffer.write(bytes(unicodestr, "utf-8")). That does not seem possible with clisp – Fredo Jan 10 '15 at 22:33
  • Is there a reason you use their unicode character codes instead of the characters themselves? I am assuming you mean "in a browser" by "via localhost". – Langston Jan 11 '15 at 03:22
  • "in a browser"=="via localhost". Same result if actual euro sign etc instead of char codes. Apache error log states: – Fredo Jan 11 '15 at 07:28
  • *** - UNIX error 14 (EFAULT): Bad address [/build/buildd/clisp-2.49/src/eval.d:573] reset() found no driver frame (sp=0x7fffbe4d9e40-0x7fffbe4d52e0) : so I guess it's somewhere in the installation – Fredo Jan 11 '15 at 07:29
  • Perhaps you might want to post another question with that issue outlined in detail. – Langston Jan 12 '15 at 06:37