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?

8
  • What is a valid string delimiter in Lisp? Commented Dec 28, 2014 at 2:43
  • AFAIK string delimiter is ' or " Commented Dec 28, 2014 at 2:52
  • modlisp-clisp (the server loop?) uses: Commented Dec 28, 2014 at 2:53
  • (defun write-header-line (key value) (write-string key apache-socket) (write-char #\NewLine apache-socket) (write-string value apache-socket) (write-header-line "Content-Type" "text/html") (write-char #\NewLine apache-socket)) Commented Dec 28, 2014 at 2:54
  • What is a valid string delimiter in Lisp? ' or "? Which one? Commented Dec 28, 2014 at 2:56

1 Answer 1

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")
Sign up to request clarification or add additional context in comments.

5 Comments

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
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".
"in a browser"=="via localhost". Same result if actual euro sign etc instead of char codes. Apache error log states:
*** - 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
Perhaps you might want to post another question with that issue outlined in detail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.