Xmpp

無法通過 Pidgin 在 localhost ejabberd 上註冊新使用者(503:服務不可用)

  • March 13, 2016

我在 localhost 上設置了 ejabberd 伺服器,現在可以訪問管理面板localhost:5280/admin

在 pidgin 中,我填寫以下值:

username: root
password: password
host: localhost
resource: 5280  

並檢查“在伺服器上創建這個新帳戶”

我的 mod_register 位於/etc/ejabberd/ejabberd.cfg

{mod_register, [
             %%
             %% After successful registration, the user receives
             %% a message with this subject and body.
             %%
             {welcome_message, {"Welcome!",
                                "Welcome to a Jabber service powered by De$
                                "For information about Jabber visit "
                                "http://www.jabber.org"}},
             %% Replace it with 'none' if you don't want to send such mess$
             %%{welcome_message, none},

             %%
             %% When a user registers, send a notification to
             %% these Jabber accounts.
             %%
             %%{registration_watchers, ["admin1@example.org"]},
             {access, register, [{allow, all}]}
            ]},

當我嘗試註冊使用者 pidgin 時顯示錯誤 503:服務不可用

我哪裡錯了?

UPD

洋涇浜日誌:

(14:13:30) connection: Activating keepalive.
(14:13:31) jabber: Sending (ssl) (zuber@localhost/5280): <iq type='set' id='purple28d4cf' to='localhost'><query xmlns='jabber:iq:register'><username>zuber</username><password>123456</password></query></iq>
(14:13:31) jabber: Recv (ssl)(163): <iq from='localhost' id='purple28d4cf' type='error'><error code='503' type='cancel'><service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/></error></iq>
(14:13:31) account: Disconnecting account zuber@localhost/5280 (0x7f06e57042b0)
(14:13:31) connection: Disconnecting connection 0x7f06e5606e30
(14:13:31) connection: Deactivating keepalive.

Ejabberd 日誌:

=ERROR REPORT==== 2016-03-08 14:13:31 ===
E(<0.397.0>:ejabberd_hooks:335) : {{case_clause,
                                   {value,{access,register,[{allow,all}]}}},
                                  [{gen_mod,get_opt,3,
                                    [{file,"gen_mod.erl"},{line,154}]},
                                   {mod_register,process_iq,4,
                                    [{file,"mod_register.erl"},{line,109}]},
                                   {mod_register,
                                    unauthenticated_iq_register,4,
                                    [{file,"mod_register.erl"},{line,78}]},
                                   {ejabberd_hooks,run_fold1,4,
                                    [{file,"ejabberd_hooks.erl"},{line,331}]},
                                   {ejabberd_c2s,
                                    process_unauthenticated_stanza,2,
                                    [{file,"ejabberd_c2s.erl"},{line,2179}]},
                                   {ejabberd_c2s,wait_for_feature_request,2,
                                    [{file,"ejabberd_c2s.erl"},{line,731}]},
                                   {p1_fsm,handle_msg,10,
                                    [{file,"p1_fsm.erl"},{line,544}]},
                                   {proc_lib,init_p_do_apply,3,
                                    [{file,"proc_lib.erl"},{line,239}]}]}
running hook: {c2s_unauthenticated_iq,
                 ["localhost",
                  {iq,"purple28d4cf",set,"jabber:iq:register",[],
                      {xmlelement,"query",
                          [{"xmlns","jabber:iq:register"}],
                          [{xmlelement,"username",[],
                               [{xmlcdata,<<"zuber">>}]},
                           {xmlelement,"password",[],
                               [{xmlcdata,<<"123456">>}]}]}},
                  {{127,0,0,1},57138}]}

我通過其他教程設置了 ejabberd,一切都開始工作了。

sudo apt-get install ejabberd

在 /etc/ejabberd/ejabberd.cfg:

  1. 取消註釋行

覆蓋本地 2. 在mod_register配置中:

%% 管理員使用者 {acl, admin, {user, “admin”, “localhost”}}。

%% 主機名 {主機,

$$ “localhost” $$}. 3. 在ACCESS RULES部分:

{訪問,註冊,

$$ {allow, all} $$}. 4. 重啟伺服器:

sudo 服務 ejabberd 重啟

引用自:https://serverfault.com/questions/762266