Launch Yaws Applications

I am completely new to erlang and yaw. After playing with the language and easy yaw functions like ehtml and normal appmods, I tried to write yapp. I followed http://yaws.hyber.org/yapp_intro.yaws and https://github.com/davide/yawn/wiki to get it more or less working. It simply consists of an .app file and a simple test.erl / beam, which only has out / 1. The brake starts without problems and loads yapp. When I start the yaw interactively and call the test: out (somehting), it works fine. When I browse the url (with browser or curl), I get

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

and nothing is returned to the client. I tried a couple of things, but I haven't found a problem yet.

I believe the problem is in my .app file ... I hope you help me. I have added the contents of .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

+4
source share
1 answer

If you closely follow the yapp instructions provided on the Yaws website , everything should work fine. Be sure to remember:

  • set the runmod global configuration variable to yapp
  • configure your arg_rewrite_mod server arg_rewrite_mod on yapp
  • in opaque server configuration, set bootstrap_yapps to yapp

To avoid having to create an mnesia database for your yapp, you can either try to install your yapp as an additional bootstrap_yapp in your server configuration, or simply use the yapp_ets_server module. Instructions for using yapp_ets_server can be found at the top of the source file .

+4
source

Source: https://habr.com/ru/post/1343736/


All Articles