From: Robert Clark

Subject: Running cgi-bin programs under AllegroServe

Date: 2002-7-2 15:24

<html>
I'm just getting started with Lisp and AllegroServe and could
(desperately) use some help.<br><br>
I simply want to be able to run a cgi program using AllegroServe. 
Anytime that I try to run a program, I get an "HTTP 500 - Internal
server error".  I can serve up images and html pages
fine.<br><br>
Here is my setup:<br><br>
directory contains (file contents are at end of email):<br>
a.lisp<br>
a.gif<br>
a.pl (755, #!/usr/bin/perl as first line, and runs fine stand-alone
producing: Content-type: text/html\nHello, world!)<br><br>
Steps:<br>
  run lisp (AllegroServe 6.1 - starts server on port 8000 and
publishes files a.gif and a.pl<br>
  enter
<a href="http://hostname:8000/a.gif" eudora="autourl">http://hostname:8000/a.gif<br>
</a>     a.gif served up properly<br>
  enter
<a href="http://hostname:8000/a.pl" eudora="autourl">http://hostname:8000/a.pl</a><br>
     get HTTP 500 error<br><br>
Any help would be greatly appreciated.<br><br>
<x-sigsep><p></x-sigsep>
Bob Clark<br><br>
<br>
<b>a.lisp</b>:<br>
(require :aserve)<br><br>
(defpackage :http-test <br>
    (:use :common-lisp :excl :net.aserve
:net.html.generator))<br><br>
(in-package :http-test)<br><br>
(net.aserve::debug-on :info t)<br>
(start :port 8000)<br><br>
(publish-file :path "/a.gif" :file "a.gif"
:content-type "image/gif")<br>
(publish :path "/a.pl"<br>
         :function #'(lambda (req
ent) <br>
                       
(run-cgi-program req ent "/a.pl")))<br><br>
<br>
<b>a.pl</b>:<br>
#!/usr/bin/perl<br>
print "Content-type: text/html\n\n";<br>
print "Hello, world!\n";</html>