设置 Yapp

发布于 2024-11-19 06:58:21 字数 2437 浏览 3 评论 0 原文

我正在尝试遵循 yapp 简介 并遇到一些基本困难。

准备工作:yaws 版本为 1.9,yapp 已安装(带文档)。 Yaws 和 Yapp 手动安装,Erlang 在 MacOS X 10.6 上使用 Homebrew 安装。

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

配置正是如此我们在 yapp 简介中看到:

<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>

我还设置了以下内容(在服务器块之前):

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 也按照 yapp 简介中的说明进行设置,并且yaws 正在使用正确的节点名启动,生成以下输出:

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>

查看哈欠创建者的 yapp 上的页面 我在“启动 yapp”之后看到一些额外的输出,看起来好像已经注册了。无论我等多久,这都不会显示。

此后,尝试访问网站不会产生所需的结果(http://localhost:8001/yapp/ 将我带到“未找到”页面)。但是,我确实看到了以下内容:

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

listen 更改为 127.0.0.1 并未更改任何结果。更改服务器名称以使其不同同样不会产生任何效果。

我觉得我缺少一些基本但根本的东西,并且四处搜索并没有提供任何好的答案。任何帮助表示赞赏。

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.

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

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

发布评论

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

评论(1

不醒的梦 2024-11-26 06:58:21

尽管问题提出已经过去一年了,而且可能作者自己已经找到了解决方案,但我希望我的答案对像我这样遇到问题并首先通过谷歌搜索到此页面的 erlang 新手有用。

所以我发现问题不在于 yapp,而在于初始 Mnesia 设置配置。我只是尝试仔细地重复维基百科中描述的所有步骤,这使我获得了成功的结果。更准确地说,首先我在 yaws.conf 文件中指定了 mnesia 目录:

mnesia_dir = ~/.mnesia

然后我重新启动了 Mnesia(mnesia:stop/0, mnesia:start/0) 并删除了 schema(mnesia:delete_schema/1)。最后,我重复了 http://yaws.hyber.org/yapp_intro.yaws 中的步骤。

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.

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