Yaws 1.8..1 and Erlyweb appmods not working as adveertised

40 views
Skip to first unread message

Carl

unread,
May 23, 2009, 9:54:01 AM5/23/09
to erlyweb
An by multiple users 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.

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>

This configuration pretty much means Erlyweb app has taken over this
server instance (sigh just way too much like Rails). But according to
Yaws docs and Yariv's blog this should not happen. So there is some
conflict with Yaws or a problem with Erlyweb.

/Carl

Davide Marquês

unread,
May 23, 2009, 10:04:04 AM5/23/09
to erl...@googlegroups.com
Hi!

I haven't used erlyweb in a while but I remember having no issues with appmods.
The way I normally setup multiple appmods is using a new line for each appmod, like so:
        appmods = <"/yaws_showarg", yaws_showarg>
        appmods = <"/noe", erlyweb>

Could you see if that solves the issue you're encountering?

Cheers,
:Davide

Steve Vinoski

unread,
May 23, 2009, 10:13:41 AM5/23/09
to erl...@googlegroups.com
On 5/23/09, Davide Marquês <nes...@gmail.com> wrote:
> Hi!
>
> I haven't used erlyweb in a while but I remember having no issues with
> appmods.
> The way I normally setup multiple appmods is using a new line for each
> appmod, like so:
> appmods = <"/yaws_showarg", yaws_showarg>
> appmods = <"/noe", erlyweb>
>
> Could you see if that solves the issue you're encountering?

Knowing what I know about the internals of yaws, I'd be very surprised
if this made a difference. The parser for appmods looks for a list of
sets of '<' PathElem, AppMod '>' tokens, one after another, just as
Carl wrote in his conf file. As I just mentioned on this same issue
over in erlang-questions, I just verified via tracing that this parser
works correctly with multiple appmods on the same line.

I'm using the very latest from github, of course, so perhaps the
problem above was an issue in the past, but if so, it isn't anymore.

--steve

Davide Marquês

unread,
May 23, 2009, 11:22:19 AM5/23/09
to erl...@googlegroups.com
Hi again,

I just uploaded a working example of the musician app:
http://github.com/davide/erlyweb/tree/50923c6cbe858b40e185719781c8ffb7cae1a7c0/examples/musician
I didn't use erlyweb:create_app/.. I simply converted the code from a package-based version I had laying around.

I tested with my erlyweb code (same repository), so if you have any issues you might want to check for differences with the official (=yariv's) branch.

Cheers,
:Davide

Carl McDade

unread,
May 23, 2009, 11:48:37 AM5/23/09
to erl...@googlegroups.com
Cool!

I will give it a try a.s.a.p.

Thanks!

2009/5/23 Davide Marquês <nes...@gmail.com>:
--
Carl McDade
Content Management Systems Consultant
www.hiveminds.co.uk
________________________
Reply all
Reply to author
Forward
0 new messages