我对erlang和yaws还是个新手。在尝试了一下语言和简单的yaws特性之后,我试着写了一个yapp。我跟踪了http://yaws.hyber.org/yapp_intro.yaws和https://github.com/davide/yawn/wiki,让它或多或少地运行起来。它只包含一个.app文件和一个简单的test.erl/beam,它只有一个out/1。当我在交互模式下运行yaws并调用test:out(某种东西)时,它工作得很好。当我浏览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>谢谢
发布于 2011-04-18 11:25:35
如果您仔细遵循yapp instructions provided at the Yaws website,一切都应该正常工作。一定要记住:
要将服务器配置块设置为yapp
bootstrap_yapps设置为yapp
,将全局runmod配置变量设置为yapp
runmod arg_rewrite_mod为了避免为您的yapp创建一个记忆数据库,您可以尝试在您的服务器配置中将您的yapp设置为一个额外的bootstrap_yapp,或者直接使用yapp_ets_server模块。您可以在top of its source file上找到使用yapp_ets_server的说明。
https://stackoverflow.com/questions/5309053
复制相似问题