hunchentoot 可以托管 CGI 应用程序吗?
我们有一个使用 python 开发的 CGI 应用程序,可以轻松地将其托管在 erlang YAWS 中:
>cat ~/yaws.conf
...
<server 192.168.1.2>
port = 8000
listen = 0.0.0.0
docroot = /media/G/www/qachina/
access_log = false
appmods = <cgi-bin, yaws_appmod_cgi>
</server>
...
现在我们希望将应用程序托管在 Lisp Web 服务器中。也许hunchentoot 可以做到吗?
真挚地!
We have a CGI application developed using python, which can be hosted in erlang YAWS easily:
>cat ~/yaws.conf
...
<server 192.168.1.2>
port = 8000
listen = 0.0.0.0
docroot = /media/G/www/qachina/
access_log = false
appmods = <cgi-bin, yaws_appmod_cgi>
</server>
...
Now we want to host the application in a lisp web server. Maybe hunchentoot can do it ?
Sincerely!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
可能与 EOL 角色有关。
从 Chunga API 文档,您可以看到读取行* 函数需要 CR 作为 EOL 标记,这不是 *nixes 的默认设置。以下应该使它工作(它对我有用):
编辑:进一步阅读 *accept-bogus-eols* 的描述 我可以明白为什么这是正常行为Chunga 的:该库本身符合 RFC2616 (HTTP 1.1),其中 HTTP 协议的默认 EOL 标记是 CRLF。
Probably something to do with EOL characters.
From Chunga API docs, you can see the read-line* function expects a CR as EOL marker, which is not the default for *nixes. The following should make it work (it works for me):
EDIT: further reading the description of *accept-bogus-eols* I can see why this is the normal behavior of Chunga: the library itself conforms to RFC2616 (HTTP 1.1) in which the HTTP protocol's default EOL marker is CRLF.
我已经安装了hunchentoot-cgi并进行了测试。以下是一个简单的python脚本文件:
当我访问http://127.0.0.1:8000时/cgi-bin/nav.py,hunchentoot 报告:
通过 hackiing hunchentoot-cgi.lisp,我发现了函数“handle-cgi-script”报告错误:
任何建议表示赞赏!
I have installed hunchentoot-cgi and tested it. The following is a simple python script file:
when i visited http://127.0.0.1:8000/cgi-bin/nav.py, hunchentoot reported:
By hackiing hunchentoot-cgi.lisp, i found the function "handle-cgi-script" reported the error:
Any suggestion is appreciated!
关于“合并路径名”的奇怪行为:
它在 SBCL REPL 中正常工作。但是,当破解“create-cgi-dispatcher-and-handler”时,我添加以下行:
如下调用:
然后访问 http://127.0.0.1:8000/cgi-bin/nav.py,它报告:
简而言之:
(merge-pathnames "nav.py" "/media/E/myapp/cgi-bin/") 在 REPL 中返回#P"/media/E/myapp/cgi-bin/nav.py"。但它在 hunchentoot-cgi.lisp 中返回“/media/E/myapp/nav.py”。
真挚地!
Strange behavior about "merge-pathnames":
it works normally in SBCL REPL. However, when hacking "create-cgi-dispatcher-and-handler", i add the following lines:
Calling it as below:
Then visiting http://127.0.0.1:8000/cgi-bin/nav.py, it reports:
In a short word:
(merge-pathnames "nav.py" "/media/E/myapp/cgi-bin/") returns #P"/media/E/myapp/cgi-bin/nav.py" in REPL. But it returns "/media/E/myapp/nav.py" in hunchentoot-cgi.lisp.
Sincerely!