我对 erlang 和 yaws 很陌生。在玩弄了语言和简单的 yaws 功能(如 ehtml 和普通 appmods)之后,我尝试编写一个 yapp。我跟着http://yaws.hyber.org/yapp_intro.yaws和https://github.com/davide/yawn/wiki让它或多或少地运行起来。它只是由一个 .app 文件和一个只有 out/1 的简单 test.erl/beam 组成。Yaws 启动没有问题并加载 yapp。当我在交互模式下运行 yaws 并调用 test:out(somehting) 时,它工作正常。当我浏览 url(使用浏览器或 curl)时,我得到一个
=ERROR REPORT==== Date ===
Yaws process died:...
并没有返回给客户。我一直在尝试一些事情,但我还没有发现问题。
我相信问题出在我的 .app 文件中......我希望你能帮助我。我在下面添加了 .app 和我的 localhost-ssl.conf 的内容。
marc@server:~$ cat /usr/lib/yaws/lib/api/ebin/api.app
{application, api,
[{description,"cloudia api as yapp"},
{vsn,"0.1"},
{modules,[]},
{registered, []},
{env, [
{yapp_appmods,[{"/",test}]},
]}]}.
marc@server:~$ sudo cat /etc/yaws/conf.d/localhost-ssl.conf
<server localhost>
port = 443
listen = 0.0.0.0
docroot = /usr/share/yaws
arg_rewrite_mod = api
#dir_listings = true
<ssl>
keyfile = /etc/yaws/yaws-key.pem
certfile = /etc/yaws/yaws-cert.pem
</ssl>
<opaque>
yapp_server_id = edo
</opaque>
</server>
谢谢