David H. Clements
David H. Clements

Reputation: 3638

Getting Yapp Set Up

I am trying to follow the yapp intro and having some basic difficulties.

Preliminaries: Version of yaws is 1.9, yapp has been installed (with docs). Yaws and Yapp installed manually, Erlang installed using Homebrew on MacOS X 10.6.

Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:8:8] [rq:8] [async-threads:0] [hipe] [kernel-poll:true]

Configuration is exactly what we see on the yapp intro:

<server localhost>
    port = 8000
    listen = 0.0.0.0
    docroot = /usr/local/var/yaws/www
    arg_rewrite_mod = yapp
    <opaque>
       yapp_server_id = edo
    </opaque>
</server>

<server localhost>
    port = 8001
    listen = 0.0.0.0
    docroot = /usr/local/var/yaws/www
    arg_rewrite_mod = yapp
    <opaque>
        yapp_server_id = ido
        bootstrap_yapps = yapp
    </opaque>
</server>

I also have the following as part of the setup (before the server blocks):

ebin_dir = /usr/local/lib/yaws/examples/ebin
ebin_dir = /usr/local/var/yaws/ebin
ebin_dir = /usr/local/lib/yapp/ebin

...

runmod = yapp

Mnesia set up as per the directions on the yapp intro as well and yaws is being launched with the correct nodename, generating the following output:

Eshell V5.8.4  (abort with ^G)
(dclements@server)1> 
=INFO REPORT==== 11-Jul-2011::13:10:58 ===
Yaws: Using config file /usr/local/etc/yaws/yaws.conf

=INFO REPORT==== 11-Jul-2011::13:10:58 ===
Ctlfile : /Users/dclements/.yaws/yaws/default/CTL

=INFO REPORT==== 11-Jul-2011::13:10:58 ===
Yaws: Listening to 0.0.0.0:8001 for <1> virtual servers:
 - http://localhost:8001 under /usr/local/var/yaws/www

=INFO REPORT==== 11-Jul-2011::13:10:58 ===
Yaws: Listening to 0.0.0.0:8000 for <1> virtual servers:
 - http://localhost:8000 under /usr/local/var/yaws/www

=INFO REPORT==== 11-Jul-2011::13:10:58 ===
Yapp starting but Yaws not ready - waiting 500 ms
=INFO REPORT==== 11-Jul-2011::13:10:59 ===
Starting yapp

(dclements@server)1>

Seeing the yawn creator's page on yapp I see some additional output after the "Starting yapp" where it looks like things are registered. This does not show no matter how long I wait.

After this, attempting to visit the websites does not produce the desired result (http://localhost:8001/yapp/ brings me to a "not found" page). I do, however, see the following:

(dclements@server)1> yapp:get_yapps().
[]
(dclements@server)2> yapp:get_bootstrap_yapps().
[{"ido",[{"/yapp",yapp}]}]

Changing the listen to 127.0.0.1 has not changed any of the results. Changing the server names so that they are different similarly does not have an effect.

I feel like there is something basic but fundamental that I am missing, and searching around has not provided any good answers. Any help is appreciated.

Upvotes: 1

Views: 709

Answers (1)

Ilya Lakhin
Ilya Lakhin

Reputation: 1944

Despite the fact that a year has passed since the question was asked, and probably the author have already found solution himself, I hope that my answer would be useful for erlang-newbies like me who faced the problem and first googled to this page.

So I have discovered that the problem is not with yapp, but with initial Mnesia setup configuration. I just simply tried to carefully repeat all steps that were described in the wiki and it resulted me to successful result. To be more precisely firstly I have specified mnesia dir in the yaws.conf file:

mnesia_dir = ~/.mnesia

then I have restarted Mnesia(mnesia:stop/0, mnesia:start/0) and deleted the schema(mnesia:delete_schema/1). And finally I have repeated steps from http://yaws.hyber.org/yapp_intro.yaws.

Upvotes: 2

Related Questions