我在设置ejabberd以使用PostgreSQL时遇到问题。我的环境是用于开发的OSX和用于生产的Debian服务器。
OSX的故事如下:
ejabberd是从源代码编译而来的,支持odbc。 erlang是通过macports安装的。
我遇到的第一个问题是erlang的psql模块。在文档中提到了从不存在的svn位置编译它们。我从二进制安装中复制了相关的.beam
到我的ejabberd lib,这似乎工作正常。
我的ejabberd配置是故意最小的,目前只通过odbc与本机pgsql驱动程序进行身份验证。然而,当ejabberd干净利落时,它实际上从未创建表结构。在processone's repo中有pg.sql,但有一个很大的警告,它已经过时,并提到表将自动创建。这是怎样以及何时发生的?我可以验证,例如尝试进行身份验证会向postgresql发送查询,但由于那里没有表,因此出错...
ejabberd配置如下:
{loglevel, 4}.
{hosts, ["localhost"]}.
{listen,
[
{{5222, {127, 0, 0, 1}}, ejabberd_c2s, [
{access, c2s},
{shaper, c2s_shaper},
{max_stanza_size, 65536}
]},
{{5269, {127, 0, 0, 1}}, ejabberd_s2s_in, [
{shaper, s2s_shaper},
{max_stanza_size, 131072}
]},
{{5280, {127, 0, 0, 1}}, ejabberd_http, [
http_bind,
web_admin
]}
]}.
{odbc_server, {pgsql, "localhost", "ejabberd", "ejabberd", "ejabberd"}}.
{auth_method, [odbc]}.
{shaper, normal, {maxrate, 1000}}.
{shaper, fast, {maxrate, 50000}}.
{host_config, "localhost", [{acl, admin, {user, "admin", "localhost"}}]}.
{acl, local, {user_regexp, ""}}.
{access, max_user_sessions, [{10, all}]}.
{access, local, [{allow, local}]}.
{access, c2s, [{deny, blocked},
{allow, all}]}.
{access, c2s_shaper, [{none, admin},
{normal, all}]}.
{access, s2s_shaper, [{fast, all}]}.
{access, announce, [{allow, admin}]}.
{access, configure, [{allow, admin}]}.
{access, muc_admin, [{allow, admin}]}.
{access, muc, [{allow, all}]}.
{access, muc_create, [{allow, local}]}.
{access, register, [{allow, all}]}.
{access, pubsub_createnode, [{allow, local}]}.
{language, "en"}.
{modules,
[
{mod_adhoc, []},
{mod_announce, [{access, announce}]},
{mod_caps, []},
{mod_configure,[]},
{mod_disco, []},
{mod_http_bind,[]},
{mod_last, []},
{mod_offline, []},
{mod_privacy, []},
{mod_private, []},
{mod_pubsub, [
{access_createnode, pubsub_createnode},
{ignore_pep_from_offline, false},
{last_item_cache, false},
{nodetree, "dag"},
{plugins, ["dag", "flat", "hometree", "pep"]},
{max_items_node, 1000}
]},
{mod_register, [
{welcome_message, {"Welcome!",
"Welcome to localhost Jabber server."}},
{access, register}
]},
{mod_roster, []},
{mod_shared_roster,[]},
{mod_time, []},
{mod_vcard, []},
{mod_version, []}
]}.
答案 0 :(得分:4)
是的,这主要是因为我最终想出来之后的文档...希望它对有类似麻烦的其他人有用。它适用于ejabberd 2.1。*,当然不适用于3系列。
\'
,这在PostgreSQL的9. *系列中表现不佳。subversion
和erlang-tools
。