[erlang-questions] Is Erlyweb working with Yaws 1.8.1? and other framework questions

Steve Vinoski <>
Sat May 23 16:05:43 CEST 2009


On 5/23/09, Carl McDade <> wrote:
> Actually that is just an excerpt from the error encountered by David
>  while going through the tutorial that is on Yariv's (the erlyweb
>  creator) website. My yaws.conf looks like this:
>
>  <server localhost>
>         port = 8080
>         listen = 0.0.0.0
>         docroot = "C:\erlang\lib\Yaws-1.81/www"
>  "C:/erlang/lib/Yaws-1.81/applications/music/www"
>         appmods = <cgi-bin, yaws_appmod_cgi> <"/music", erlyweb>
>
>         <opaque>
>                 appname = "music"
>         </opaque>
>  </server>
>
>  The problems is that in the above appmod music is not found and
>  errors. Surfing to http://localhost:8080/music produces an appmod
>  error.

I took this server conf and replaced erlyweb with an appmod of my own
that returns a simple JSON string. It worked just fine.

>  But if you change the configuration so that the appmod music is the
>  only one and under http://localhost:8080 then the config below works:
>
>  <server localhost>
>         port = 8080
>         listen = 0.0.0.0
>         docroot = "C:\erlang\lib\Yaws-1.81/www"
>  "C:/erlang/lib/Yaws-1.81/applications/music/www"
>         appmods = <"music", erlyweb>
>
>         <opaque>
>                 appname = "music"
>         </opaque>
>  </server>
>
>  So there is some conflict with Yaws or a problem with Erlyweb.

I don't think yaws is to blame here. I used dbg tracing to verify that
the code that parses the conf file is correctly picking up both your
cgi-bin and music appmods and storing them in its internal conf
structures. Tracing also shows the code that dispatches to the music
appmod works exactly as expected with my simple appmod in place of
erlyweb.

I don't know the internal details of erlyweb, but maybe the fact that
this second conf file works is due to the opaque appname "music"
matching the appmod's "music" registration point? Note that in your
first conf file above the appmod is registered under "/music", not
"music".

--steve



More information about the erlang-questions mailing list