运行雅司病应用程序

发布于 10-22 16:40 字数 1321 浏览 6 评论 0原文

我对 erlang 和雅司病很陌生。在尝试了该语言和简单的雅司病功能(如 ehtml 和普通的 appmods)之后,我尝试编写一个 yapp。我关注了 http://yaws.hyber.org/yapp_intro.yawshttps://github.com/davide/yawn/wiki 以使其或多或少运行。它仅由一个 .app 文件和一个简单的 test.erl/beam 组成,其中只有一个 out/1。 Yaws 启动没有问题并加载 yapp。当我在交互模式下运行 yaws 并调用 test:out(somehting) 时,它工作正常。当我浏览该网址(使用浏览器或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>

谢谢

I am quite new to erlang and yaws. I after playing around with the language and easy yaws features like ehtml and normal appmods I tried to write a yapp. I followed http://yaws.hyber.org/yapp_intro.yaws and https://github.com/davide/yawn/wiki to get it more or less running. It simply consists of an .app file and a simple test.erl/beam that just has a out/1.
Yaws starts without a problem and loads the yapp. When I run yaws in the interactive mode and call test:out(somehting) it works fine. When I surf the url (with browser or curl) I get an

=ERROR REPORT==== Date ===
Yaws process died:...

and nothing returned to the client. I have been trying around a couple of things, but I haven't found the problem yet.

I believe the problem is in my .app file...
I hope you can help my. I added the content of the .app and my localhost-ssl.conf below.

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>

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如梦亦如幻2024-10-29 16:40:31

如果您仔细遵循 Yaws 网站上提供的 yapp 说明,一切都会正常工作。请务必记住:

  • 将全局 runmod 配置变量设置为 yapp
  • 将服务器配置 arg_rewrite_mod 设置为 yapp
  • 您的服务器配置 opaque 块,将 bootstrap_yapps 设置为 yapp

为了避免需要为您的 yapp 创建 mnesia 数据库,您可以尝试设置您的 yapp作为服务器配置中的附加 bootstrap_yapp,或者仅使用 yapp_ets_server 模块。您可以在 源文件顶部

If you carefully follow the yapp instructions provided at the Yaws website everything should work fine. Be sure to remember to:

  • set the global runmod configuration variable to yapp
  • set your server configuration arg_rewrite_mod to yapp
  • within your server configuration opaque block, set bootstrap_yapps to yapp

To avoid the need to create an mnesia database for your yapp you can either try setting your yapp as an additional bootstrap_yapp in your server configuration, or just use the yapp_ets_server module instead. You can find instructions for using yapp_ets_server at the top of its source file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文